-
Notifications
You must be signed in to change notification settings - Fork 16
/
DAWorkbenchConfig.cmake.in
53 lines (46 loc) · 1.96 KB
/
DAWorkbenchConfig.cmake.in
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
# DAWorkbench的config file 此处将列举所有的components
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# 这里PROJECT_NAME就作为包名
set(_package_name @PROJECT_NAME@)
set(_${_package_name}_supported_components DAUtils DAAxOfficeWrapper DAMessageHandler DAPyBindQt DAPyScripts DAData DACommonWidgets DAPyCommonWidgets DAGraphicsView DAWorkFlow DAFigure DAGui DAInterface DAPluginSupport)
set(_${_package_name}_available_components "")
# 把DA_ENABLE_PYTHON变量传递到此处
set(DA_ENABLE_PYTHON @DA_ENABLE_PYTHON@)
# 遍历所有要导入的模块
foreach(_component ${${_package_name}_FIND_COMPONENTS})
# 首先判断是否在所支持列表中
if(_component IN_LIST _${_package_name}_supported_components)
set(__target ${_package_name}::${_component})
if(TARGET ${__target})
# 避免重复加载
continue()
else()
find_package(${_component}
REQUIRED
PATHS ${CMAKE_CURRENT_LIST_DIR}
)
endif()
else()
set(${_package_name}_FOUND FALSE)
set(${_package_name}_NOT_FOUND_MESSAGE "Unknown component: ${__target}.")
break()
endif()
endforeach()
if(NOT DEFINED @PROJECT_NAME@_FOUND)
set(@PROJECT_NAME@_FOUND TRUE)
set(@PROJECT_NAME@_VERSION "@PROJECT_VERSION@")
set(@PROJECT_NAME@_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
set(@PROJECT_NAME@_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
set(@PROJECT_NAME@_VERSION_PATCH "@PROJECT_VERSION_PATCH@")
#set(@PROJECT_NAME@_VERSION_TWEAK "@PROJECT_VERSION_TWEAK@")
set(@PROJECT_NAME@_DESCRIPTION "@PROJECT_DESCRIPTION@")
set(@PROJECT_NAME@_HOMEPAGE_URL "@PROJECT_HOMEPAGE_URL@")
set(@PROJECT_NAME@_COMMIT "@PROJECT_VERSION_COMMIT@")
set(@PROJECT_NAME@_COMPILE_DATETIME "@PROJECT_COMPILE_DATETIME@")
endif()
include(FeatureSummary)
set_package_properties(@PROJECT_NAME@ PROPERTIES
DESCRIPTION "@PROJECT_DESCRIPTION@"
URL "@PROJECT_HOMEPAGE_URL@"
)