Skip to content

Commit

Permalink
Add CMake option WITH_STAGED_PLUGINS (ON by default)
Browse files Browse the repository at this point in the history
- Core plugins remain available once staged (no need to re-build targets, unless source updated or build directory cleared)
- Once plugins are staged, setting WITH_STAGED_PLUGINS to OFF allows for much quicker subsequent builds
- PyQGIS utilities, console and installer are always staged, regardless of WITH_STAGED_PLUGINS
  • Loading branch information
dakcarto committed Oct 31, 2012
1 parent 9918350 commit d7a7a46
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -76,6 +76,7 @@ IF (WITH_BINDINGS)
# as otherwise user has to use PYTHONPATH environemnt variable to add
# QGIS bindings to package search path
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
SET (WITH_STAGED_PLUGINS TRUE CACHE BOOL "Stage-install core Python plugins to run from build directory? (utilities, console and installer are always staged)")
SET (WITH_PY_COMPILE FALSE CACHE BOOL "Determines whether Python modules in staged or installed locations are byte-compiled")
# concatenate QScintilla2 API files
SET (WITH_QSCIAPI TRUE CACHE BOOL "Determines whether the QScintilla2 API files will be updated and concatenated")
Expand Down
30 changes: 16 additions & 14 deletions python/plugins/CMakeLists.txt
Expand Up @@ -8,20 +8,22 @@ ENDIF(WITH_PY_COMPILE)

MACRO (PLUGIN_INSTALL plugin subdir )
INSTALL(FILES ${ARGN} DESTINATION ${QGIS_DATA_DIR}/python/plugins/${plugin}/${subdir})
STRING(REPLACE "/" "_" subdir_sane "${subdir}")
ADD_CUSTOM_TARGET(${plugin}_${subdir_sane}_stageinstall ALL DEPENDS ${ARGN})
IF(WITH_PY_COMPILE)
ADD_DEPENDENCIES(pycompile_staged ${plugin}_${subdir_sane}_stageinstall)
ENDIF(WITH_PY_COMPILE)
FOREACH(file ${ARGN})
ADD_CUSTOM_COMMAND(TARGET ${plugin}_${subdir_sane}_stageinstall
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}
COMMAND ${CMAKE_COMMAND} -E copy \"${file}\" ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
#COMMENT "copying ${file} to ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}"
)
ENDFOREACH(file)
IF(WITH_STAGED_PLUGINS OR "${plugin}" STREQUAL "plugin_installer")
STRING(REPLACE "/" "_" subdir_sane "${subdir}")
ADD_CUSTOM_TARGET(${plugin}_${subdir_sane}_stageinstall ALL DEPENDS ${ARGN})
IF(WITH_PY_COMPILE)
ADD_DEPENDENCIES(pycompile_staged ${plugin}_${subdir_sane}_stageinstall)
ENDIF(WITH_PY_COMPILE)
FOREACH(file ${ARGN})
ADD_CUSTOM_COMMAND(TARGET ${plugin}_${subdir_sane}_stageinstall
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}
COMMAND ${CMAKE_COMMAND} -E copy \"${file}\" ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
#COMMENT "copying ${file} to ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}"
)
ENDFOREACH(file)
ENDIF()
ENDMACRO (PLUGIN_INSTALL)


Expand Down

0 comments on commit d7a7a46

Please sign in to comment.