Skip to content

Commit

Permalink
Rename staged plugin install rules to use dashes, not underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Santilli committed Mar 11, 2013
1 parent 6741cff commit aba568b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions python/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# will function when app is run from build directory

# When staging all plugins, use the following make targets:
# staged_plugins - stage plugins (usually after repo pull/build and project make)
# staged_plugins_pyc - stage and byte-compile all Python scripts
# clean_staged_plugins - removes the plugins directory and all contents
# staged-plugins - stage plugins (usually after repo pull/build and project make)
# staged-plugins-pyc - stage and byte-compile all Python scripts
# clean-staged-plugins - removes the plugins directory and all contents
#
# When developing on a plugin, use the following make targets:
# staged_[plugin_dir_name] - stage specific plugin, regenerating any changed resources
# clean_staged_[plugin_dir_name] - removes the plugin directory and its contents
# staged-[plugin_dir_name] - stage specific plugin, regenerating any changed resources
# clean-staged-[plugin_dir_name] - removes the plugin directory and its contents
#
# NOTE: regular project 'make install' is unaffected

ADD_CUSTOM_TARGET(staged_plugins)
ADD_CUSTOM_TARGET(staged-plugins)

ADD_CUSTOM_TARGET(staged_plugins_pyc DEPENDS staged_plugins
ADD_CUSTOM_TARGET(staged-plugins-pyc DEPENDS staged-plugins
COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY}/plugins"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
COMMENT "Byte-compiling staged Python plugins..."
Expand All @@ -23,13 +23,13 @@ ADD_CUSTOM_TARGET(staged_plugins_pyc DEPENDS staged_plugins
# plugins can also be staged with CMake option at build time
IF(WITH_STAGED_PLUGINS)
IF(WITH_PY_COMPILE)
ADD_CUSTOM_TARGET(staged_plugins_on_build ALL DEPENDS staged_plugins_pyc)
ADD_CUSTOM_TARGET(staged-plugins-on-build ALL DEPENDS staged-plugins-pyc)
ELSE(WITH_PY_COMPILE)
ADD_CUSTOM_TARGET(staged_plugins_on_build ALL DEPENDS staged_plugins)
ADD_CUSTOM_TARGET(staged-plugins-on-build ALL DEPENDS staged-plugins)
ENDIF(WITH_PY_COMPILE)
ENDIF(WITH_STAGED_PLUGINS)

ADD_CUSTOM_TARGET(clean_staged_plugins
ADD_CUSTOM_TARGET(clean-staged-plugins
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins
)

Expand All @@ -39,33 +39,33 @@ MACRO (PLUGIN_INSTALL plugin subdir )
INSTALL(FILES ${ARGN} DESTINATION ${QGIS_DATA_DIR}/python/plugins/${plugin}/${subdir})
STRING(REPLACE "/" "_" subdir_sane "${subdir}")
IF(WITH_STAGED_PLUGINS)
ADD_CUSTOM_TARGET(${plugin}_${subdir_sane} DEPENDS ${ARGN})
ADD_CUSTOM_TARGET(${plugin}-${subdir_sane} DEPENDS ${ARGN})
ELSE(WITH_STAGED_PLUGINS)
ADD_CUSTOM_TARGET(${plugin}_${subdir_sane} ALL DEPENDS ${ARGN})
ADD_CUSTOM_TARGET(${plugin}-${subdir_sane} ALL DEPENDS ${ARGN})
ENDIF(WITH_STAGED_PLUGINS)

# for staged plugin install (to run from build directory)
ADD_CUSTOM_TARGET(${plugin}_${subdir_sane}_stageinstall DEPENDS ${ARGN})
ADD_CUSTOM_COMMAND(TARGET ${plugin}_${subdir_sane}_stageinstall
ADD_CUSTOM_TARGET(${plugin}-${subdir_sane}-stageinstall DEPENDS ${ARGN})
ADD_CUSTOM_COMMAND(TARGET ${plugin}-${subdir_sane}-stageinstall
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
FOREACH(file ${ARGN})
ADD_CUSTOM_COMMAND(TARGET ${plugin}_${subdir_sane}_stageinstall
ADD_CUSTOM_COMMAND(TARGET ${plugin}-${subdir_sane}-stageinstall
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${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)
ADD_DEPENDENCIES(staged_plugins ${plugin}_${subdir_sane}_stageinstall)
ADD_DEPENDENCIES(staged-plugins ${plugin}-${subdir_sane}-stageinstall)

IF(TARGET staged_${plugin})
ADD_DEPENDENCIES(staged_${plugin} ${plugin}_${subdir_sane}_stageinstall)
ADD_DEPENDENCIES(staged_${plugin} ${plugin}-${subdir_sane}-stageinstall)
ELSE(TARGET staged_${plugin})
ADD_CUSTOM_TARGET(staged_${plugin} DEPENDS ${plugin}_${subdir_sane}_stageinstall)
ADD_CUSTOM_TARGET(clean_staged_${plugin}
ADD_CUSTOM_TARGET(staged_${plugin} DEPENDS ${plugin}-${subdir_sane}-stageinstall)
ADD_CUSTOM_TARGET(clean-staged-${plugin}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}
)
ENDIF(TARGET staged_${plugin})
Expand Down

0 comments on commit aba568b

Please sign in to comment.