File: CMakeLists.txt

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (59 lines) | stat: -rw-r--r-- 2,146 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# See ../CMakeLists.txt for info on staged-plugins* and clean-staged-plugins targets
#
# 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
#
# NOTE: regular project 'make install' is unaffected

file(WRITE ${CMAKE_BINARY_DIR}/stagecount 0)

macro (PLUGIN_INSTALL plugin subdir )
  file(READ ${CMAKE_BINARY_DIR}/stagecount n)
  math(EXPR n "${n}+1")
  file(WRITE ${CMAKE_BINARY_DIR}/stagecount ${n})

  # regular project build's install command and target
  install(FILES ${ARGN} DESTINATION ${QGIS_DATA_DIR}/python/plugins/${plugin}/${subdir})

  set(_cmake ${CMAKE_BINARY_DIR}/python/plugins/${plugin}/stageinstall.cmake)

  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)

    add_custom_command(TARGET zzz-${plugin}-stageinstall
      COMMAND ${CMAKE_COMMAND} -P ${_cmake}
    )

    add_custom_target(clean-staged-${plugin}
      COMMAND ${CMAKE_COMMAND} -E remove_directory ${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}
    )

    add_dependencies(staged-plugins zzz-${plugin}-stageinstall)
    add_custom_target(staged-${plugin} DEPENDS zzz-${plugin}-stageinstall)
    file(WRITE ${_cmake} "")
  endif()

  add_custom_target(zzz-${plugin}-${n}-depend DEPENDS ${ARGN})
  add_dependencies(zzz-${plugin}-depend zzz-${plugin}-${n}-depend)

  file(APPEND ${_cmake} "file(MAKE_DIRECTORY \"${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}\")
")

  foreach(file ${ARGN})
    get_filename_component(_file "${file}" ABSOLUTE)
    file(APPEND ${_cmake} "file(COPY \"${_file}\" DESTINATION \"${PYTHON_OUTPUT_DIRECTORY}/plugins/${plugin}/${subdir}\")
")
  endforeach(file)
endmacro (PLUGIN_INSTALL)

if (WITH_GUI)
	add_subdirectory(db_manager)
endif()
add_subdirectory(processing)
add_subdirectory(grassprovider)
add_subdirectory(MetaSearch)

PY_COMPILE(staged-plugins "${PYTHON_OUTPUT_DIRECTORY}/plugins")