2014-05-20 18:17:23 -06:00
|
|
|
# See ../CMakeLists.txt for info on staged-plugins* and clean-staged-plugins targets
|
2013-02-03 03:42:12 -07:00
|
|
|
#
|
|
|
|
# When developing on a plugin, use the following make targets:
|
2013-03-11 12:16:06 +01:00
|
|
|
# staged-[plugin_dir_name] - stage specific plugin, regenerating any changed resources
|
|
|
|
# clean-staged-[plugin_dir_name] - removes the plugin directory and its contents
|
2013-02-03 03:42:12 -07:00
|
|
|
#
|
|
|
|
# NOTE: regular project 'make install' is unaffected
|
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/stagecount 0)
|
2013-08-07 00:49:18 +02:00
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
macro (PLUGIN_INSTALL plugin subdir )
|
|
|
|
file(READ ${CMAKE_BINARY_DIR}/stagecount n)
|
|
|
|
math(EXPR n "${n}+1")
|
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/stagecount ${n})
|
2015-07-10 21:05:27 +02:00
|
|
|
|
2013-02-03 03:42:12 -07:00
|
|
|
# regular project build's install command and target
|
2020-11-11 11:15:34 +01:00
|
|
|
install(FILES ${ARGN} DESTINATION ${QGIS_DATA_DIR}/python/plugins/${plugin}/${subdir})
|
2015-07-09 00:03:27 +02:00
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
set(_cmake ${CMAKE_BINARY_DIR}/python/plugins/${plugin}/stageinstall.cmake)
|
2015-07-09 00:03:27 +02:00
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
if(NOT TARGET zzz-${plugin}-stageinstall)
|
|
|
|
add_custom_target(zzz-${plugin}-stageinstall)
|
|
|
|
add_custom_target(zzz-${plugin}-depend)
|
|
|
|
add_dependencies(zzz-${plugin}-stageinstall zzz-${plugin}-depend)
|
2015-07-09 00:03:27 +02:00
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
add_custom_command(TARGET zzz-${plugin}-stageinstall
|
2016-04-12 13:38:56 +02:00
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${_cmake}
|
2013-02-03 03:42:12 -07:00
|
|
|
)
|
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
add_custom_target(clean-staged-${plugin}
|
2013-02-03 03:42:12 -07:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}
|
|
|
|
)
|
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
add_dependencies(staged-plugins zzz-${plugin}-stageinstall)
|
|
|
|
add_custom_target(staged-${plugin} DEPENDS zzz-${plugin}-stageinstall)
|
|
|
|
file(WRITE ${_cmake} "")
|
|
|
|
endif()
|
2015-07-10 21:05:27 +02:00
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
add_custom_target(zzz-${plugin}-${n}-depend DEPENDS ${ARGN})
|
|
|
|
add_dependencies(zzz-${plugin}-depend zzz-${plugin}-${n}-depend)
|
2015-07-10 21:05:27 +02:00
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
file(APPEND ${_cmake} "file(MAKE_DIRECTORY \"${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}\")
|
2015-07-10 21:05:27 +02:00
|
|
|
")
|
|
|
|
|
2020-11-11 11:15:34 +01:00
|
|
|
foreach(file ${ARGN})
|
|
|
|
get_filename_component(_file "${file}" ABSOLUTE)
|
|
|
|
file(APPEND ${_cmake} "file(COPY \"${_file}\" DESTINATION \"${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}\")
|
2015-07-10 21:05:27 +02:00
|
|
|
")
|
2020-11-11 11:15:34 +01:00
|
|
|
endforeach(file)
|
|
|
|
endmacro (PLUGIN_INSTALL)
|
|
|
|
|
|
|
|
if (WITH_GUI)
|
|
|
|
add_subdirectory(db_manager)
|
|
|
|
endif()
|
|
|
|
add_subdirectory(processing)
|
|
|
|
add_subdirectory(MetaSearch)
|
2014-05-20 18:17:23 -06:00
|
|
|
|
|
|
|
PY_COMPILE(staged-plugins "${PYTHON_OUTPUT_DIRECTORY}/plugins")
|