forked from MITK/MITK
-
Notifications
You must be signed in to change notification settings - Fork 2
/
MITKConfig.cmake.in
313 lines (250 loc) · 11.2 KB
/
MITKConfig.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
if(CMAKE_VERSION VERSION_LESS @MITK_CMAKE_MINIMUM_REQUIRED_VERSION@)
message(FATAL_ERROR "MITK requires at least CMake Version @MITK_CMAKE_MINIMUM_REQUIRED_VERSION@")
endif()
# The MITK version number
set(MITK_VERSION_MAJOR "@MITK_VERSION_MAJOR@")
set(MITK_VERSION_MINOR "@MITK_VERSION_MINOR@")
set(MITK_VERSION_PATCH "@MITK_VERSION_PATCH@")
set(MITK_VERSION_STRING "@MITK_VERSION_STRING@")
#-----------------------------------------------------------------------------
# C++ language standard
#-----------------------------------------------------------------------------
set(MITK_CXX_STANDARD @MITK_CXX_STANDARD@)
#-----------------------------------------------------------------------------
# Include required CMake scripts
#-----------------------------------------------------------------------------
# Update the CMake module path
set(MITK_CMAKE_MODULE_PATH "@MITK_SOURCE_DIR@/CMake")
list(APPEND CMAKE_MODULE_PATH ${MITK_CMAKE_MODULE_PATH})
# Standard CMake macros
include(CMakeParseArguments)
include(FeatureSummary)
include(FindPackageHandleStandardArgs)
include(GenerateExportHeader)
# Include MITK macros
include(MacroParseArguments)
include(mitkFunctionAddCustomModuleTest)
include(mitkFunctionCheckMitkCompatibility)
include(mitkFunctionCheckModuleDependencies)
include(mitkFunctionConfigureVisualStudioUserProjectFile)
include(mitkFunctionCreateBlueBerryApplication)
include(mitkFunctionCreateCommandLineApp)
include(mitkFunctionCreateModule)
include(mitkFunctionCreatePlugin)
include(mitkFunctionCreateProvisioningFile)
include(mitkFunctionCreateWindowsBatchScript)
include(mitkFunctionGetLibrarySearchPaths)
include(mitkFunctionInstallAutoLoadModules)
include(mitkFunctionInstallCTKPlugin)
include(mitkFunctionInstallProvisioningFiles)
include(mitkFunctionInstallThirdPartyCTKPlugins)
include(mitkFunctionOrganizeSources)
include(mitkFunctionUseModules)
include(mitkMacroCreateExecutable)
include(mitkMacroCreateModuleTests)
include(mitkMacroFindDependency)
include(mitkMacroGenerateToolsLibrary)
include(mitkMacroGetPMDPlatformString)
include(mitkMacroInstall)
include(mitkMacroInstallHelperApp)
include(mitkMacroInstallTargets)
include(mitkMacroMultiplexPicType)
#-----------------------------------------------------------------------------
# MITK flags and directories
#-----------------------------------------------------------------------------
# MITK compiler flags
set(MITK_C_FLAGS "@MITK_C_FLAGS@")
set(MTTK_C_FLAGS_DEBUG "@MITK_C_FLAGS_DEBUG@")
set(MITK_C_FLAGS_RELEASE "@MITK_C_FLAGS_RELEASE@")
set(MITK_CXX_FLAGS "@MITK_CXX_FLAGS@")
set(MTTK_CXX_FLAGS_DEBUG "@MITK_CXX_FLAGS_DEBUG@")
set(MITK_CXX_FLAGS_RELEASE "@MITK_CXX_FLAGS_RELEASE@")
# MITK linker flags
set(MITK_EXE_LINKER_FLAGS "@MITK_EXE_LINKER_FLAGS@")
set(MITK_SHARED_LINKER_FLAGS "@MITK_SHARED_LINKER_FLAGS@")
set(MITK_MODULE_LINKER_FLAGS "@MITK_MODULE_LINKER_FLAGS@")
# MITK specific directories
set(MITK_SOURCE_DIR "@MITK_SOURCE_DIR@")
set(MITK_BINARY_DIR "@MITK_BINARY_DIR@")
set(MITK_CMAKE_DIR "@MITK_CMAKE_DIR@")
# MITK output directories
set(MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY "@MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
set(MITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY "@MITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY@")
set(MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY "@MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
#-----------------------------------------------------------------------------
# Miscellaneous variables
#-----------------------------------------------------------------------------
# Internal version numbers, used for approximate compatibility checks
# of a MITK development version (non-release).
set(MITK_VERSION_PLUGIN_SYSTEM 2) # dropped legacy BlueBerry plug-in CMake support
set(MITK_DATA_DIR "@MITK_DATA_DIR@")
set(UTILITIES_DIR "@UTILITIES_DIR@")
set(REGISTER_QFUNCTIONALITY_CPP_IN "@REGISTER_QFUNCTIONALITY_CPP_IN@")
set(MITK_DOXYGEN_TAGFILE_NAME "@MITK_DOXYGEN_TAGFILE_NAME@")
set(MITK_LEGACY_EXPORT_MACRO_NAME 1)
set(DCMTK_CMAKE_DEBUG_POSTFIX @DCMTK_CMAKE_DEBUG_POSTFIX@)
# Get the canonical name of the directory to avoid potential case mismatch,
# e.g. in the drive letter on Windows.
get_filename_component(CMAKE_CURRENT_LIST_DIR_REALPATH ${CMAKE_CURRENT_LIST_DIR} REALPATH)
if(CMAKE_CURRENT_LIST_DIR_REALPATH STREQUAL MITK_BINARY_DIR)
set(MITK_EXTERNAL_PROJECT_PREFIX @MITK_EXTERNAL_PROJECT_PREFIX@)
endif()
set(MITK_MODULES_PACKAGE_DEPENDS_DIR "@MITK_MODULES_PACKAGE_DEPENDS_DIR@")
if(MODULES_PACKAGE_DEPENDS_DIRS)
list(APPEND MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
list(REMOVE_DUPLICATES MODULES_PACKAGE_DEPENDS_DIRS)
else()
set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
endif()
#-----------------------------------------------------------------------------
# External dependencies
#-----------------------------------------------------------------------------
list(APPEND CMAKE_PREFIX_PATH "@MITK_EXTERNAL_PROJECT_PREFIX@")
# -----------------------------------------
# Qt variables and dependencies
set(MITK_USE_Qt5 @MITK_USE_Qt5@)
if(MITK_USE_Qt5)
set(MITK_QT5_MINIMUM_VERSION @MITK_QT5_MINIMUM_VERSION@)
set(MITK_QT5_COMPONENTS @MITK_QT5_COMPONENTS@)
mitkMacroFindDependency(Qt5 ${MITK_QT5_MINIMUM_VERSION} COMPONENTS ${MITK_QT5_COMPONENTS})
endif()
# -----------------------------------------
# Special Python variables
set(MITK_USE_Python3 @MITK_USE_Python3@)
if(MITK_USE_Python3)
set(PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@" CACHE FILEPATH "")
set(PYTHON_INCLUDE_DIR "@PYTHON_INCLUDE_DIR@" CACHE PATH "")
set(PYTHON_LIBRARY "@PYTHON_LIBRARY@" CACHE FILEPATH "")
set(PYTHON_INCLUDE_DIR2 "@PYTHON_INCLUDE_DIR2@" CACHE PATH "")
mitkMacroFindDependency(Python3 COMPONENTS Interpreter Development NumPy)
endif()
# -----------------------------------------
# Special Boost variables
set(MITK_USE_Boost_LIBRARIES @MITK_USE_Boost_LIBRARIES@)
set(MITK_USE_SYSTEM_Boost @MITK_USE_SYSTEM_Boost@)
set(BOOST_ROOT "@BOOST_ROOT@" CACHE PATH "")
set(BOOST_LIBRARYDIR "@BOOST_LIBRARYDIR@" CACHE PATH "")
set(Boost_ADDITIONAL_VERSIONS 1.74 1.74.0)
# We need this later for a DCMTK workaround
set(_dcmtk_dir_orig "@DCMTK_DIR@")
# -----------------------------------------
# External dependencies from the superbuild
# or injected from somewhere else via
# <project>_DIR variables.
@MITK_CONFIG_EXTERNAL_PROJECTS@
# Ensure the MITK module path comes first
set(CMAKE_MODULE_PATH ${MITK_CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH})
# -----------------------------------------
# Special handling for DCMTK
if(MITK_USE_DCMTK)
# Due to the preferred CONFIG mode in find_package calls above,
# the DCMTKConfig.cmake file is read, which does not provide useful
# package information. We explictly need MODULE mode to find DCMTK.
if(${_dcmtk_dir_orig} MATCHES "${MITK_EXTERNAL_PROJECT_PREFIX}.*")
# Help our FindDCMTK.cmake script find our super-build DCMTK
set(DCMTK_DIR ${MITK_EXTERNAL_PROJECT_PREFIX})
else()
# Use the original value
set(DCMTK_DIR ${_dcmtk_dir_orig})
endif()
find_package(DCMTK REQUIRED MODULE)
endif()
# -----------------------------------------
# Special handling for DCMQI
if(MITK_USE_DCMQI)
# Due to the preferred CONFIG mode in find_package calls above,
# the DCMQIConfig.cmake file is read, which does not provide useful
# package information. We explictly need MODULE mode to find DCMQI.
# Help our FindDCMQI.cmake script find our super-build DCMQI
set(DCMQI_DIR ${MITK_EXTERNAL_PROJECT_PREFIX})
find_package(DCMQI REQUIRED)
endif()
# -----------------------------------------
# Special handling for Boost
if(MITK_USE_Boost)
link_directories(${Boost_LIBRARY_DIRS})
endif()
# -----------------------------------------
# Special handling for OpenIGTLink
if(MITK_USE_OpenIGTLink)
link_directories(${OpenIGTLink_LIBRARY_DIRS})
endif()
# -----------------------------------------
# Internal project dependencies
set(CppMicroServices_DIR "@CppMicroServices_DIR@")
mitkMacroFindDependency(CppMicroServices)
set(MITK_USE_BLUEBERRY @MITK_USE_BLUEBERRY@)
if(MITK_USE_BLUEBERRY)
set(MITK_PLUGIN_USE_FILE "@MITK_PLUGIN_USE_FILE@")
if(MITK_PLUGIN_USE_FILE)
if(EXISTS "${MITK_PLUGIN_USE_FILE}")
include("${MITK_PLUGIN_USE_FILE}")
endif()
endif()
set(MITK_PLUGIN_PROVISIONING_FILE "@MITK_EXTAPP_PROVISIONING_FILE@")
set(MITK_PROVISIONING_FILES
"${BLUEBERRY_PLUGIN_PROVISIONING_FILE}"
"${MITK_PLUGIN_PROVISIONING_FILE}")
endif()
set(BLUEBERRY_USE_QT_HELP @BLUEBERRY_USE_QT_HELP@)
if(BLUEBERRY_USE_QT_HELP AND DOXYGEN_VERSION VERSION_LESS "1.8.7")
message("Setting BLUEBERRY_USE_QT_HELP to OFF because Doxygen version 1.8.7 or newer not found.")
set(BLUEBERRY_USE_QT_HELP OFF)
endif()
set(BLUEBERRY_QTPLUGIN_PATH "@BLUEBERRY_QTPLUGIN_PATH@")
set(QT_HELPGENERATOR_EXECUTABLE "@QT_HELPGENERATOR_EXECUTABLE@")
set(QT_COLLECTIONGENERATOR_EXECUTABLE "@QT_COLLECTIONGENERATOR_EXECUTABLE@")
set(QT_ASSISTANT_EXECUTABLE "@QT_ASSISTANT_EXECUTABLE@")
set(QT_XMLPATTERNS_EXECUTABLE "@QT_XMLPATTERNS_EXECUTABLE@")
#-----------------------------------------------------------------------------
# MITK sub-project variables
#-----------------------------------------------------------------------------
# External SDK directories
set(MITK_PMD_SDK_DIR @MITK_PMD_SDK_DIR@)
# MITK ToF use variables
set(MITK_TOF_PMDCAMCUBE_AVAILABLE @MITK_USE_TOF_PMDCAMCUBE@)
if(MITK_TOF_PMDCAMCUBE_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_PMDCAMCUBE "Enable support for PMD Cam Cube" @MITK_USE_TOF_PMDCAMCUBE@)
mark_as_advanced(MITK_USE_TOF_PMDCAMCUBE)
endif()
set(MITK_TOF_PMDCAMBOARD_AVAILABLE @MITK_USE_TOF_PMDCAMBOARD@)
if(MITK_TOF_PMDCAMBOARD_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_PMDCAMBOARD "Enable support for PMD Cam Board" @MITK_USE_TOF_PMDCAMBOARD@)
mark_as_advanced(MITK_USE_TOF_PMDCAMBOARD)
endif()
set(MITK_TOF_PMDO3_AVAILABLE @MITK_USE_TOF_PMDO3@)
if(MITK_TOF_PMDO3_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_PMDO3 "Enable support for PMD =3" @MITK_USE_TOF_PMDO3@)
mark_as_advanced(MITK_USE_TOF_PMDO3)
endif()
set(MITK_TOF_KINECT_AVAILABLE @MITK_USE_TOF_KINECT@)
if(MITK_TOF_KINECT_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_KINECT "Enable support for Kinect" @MITK_USE_TOF_KINECT@)
mark_as_advanced(MITK_USE_TOF_KINECT)
endif()
set(MITK_TOF_MESASR4000_AVAILABLE @MITK_USE_TOF_MESASR4000@)
if(MITK_TOF_MESASR4000_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_MESASR4000 "Enable support for MESA SR4000" @MITK_USE_TOF_MESASR4000@)
mark_as_advanced(MITK_USE_TOF_MESASR4000)
endif()
if(MITK_USE_IGT)
#include("${MITK_DIR}/mitkIGTConfig.cmake")
endif()
#-----------------------------------------------------------------------------
# Import MITK targets and set custom properties
#-----------------------------------------------------------------------------
if(NOT MITK_EXPORTS_FILE_INCLUDED)
if(EXISTS "@MITK_EXPORTS_FILE@")
set(MITK_EXPORTS_FILE_INCLUDED 1)
include("@MITK_EXPORTS_FILE@")
endif()
endif()
# Set properties on exported targets
@MITK_EXPORTED_TARGET_PROPERTIES@
#-----------------------------------------------------------------------------
# Install rules
#-----------------------------------------------------------------------------
# Install rules for ToF libraries loaded at runtime
if(EXISTS "@MITK_BINARY_DIR@/mitkToFHardwareInstallRules.cmake")
include("@MITK_BINARY_DIR@/mitkToFHardwareInstallRules.cmake")
endif()