forked from pieper/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SuperBuild.cmake
492 lines (423 loc) · 17.7 KB
/
SuperBuild.cmake
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
################################################################################
#
# Program: 3D Slicer
#
# Copyright (c) Kitware Inc.
#
# See COPYRIGHT.txt
# or http://www.slicer.org/copyright/copyright.txt for details.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file was originally developed by
# Dave Partyka and Jean-Christophe Fillion-Robin, Kitware Inc.
# and was partially funded by NIH grant 3P41RR013218-12S1
#
################################################################################
#-----------------------------------------------------------------------------
# Git protocole option
#-----------------------------------------------------------------------------
option(${CMAKE_PROJECT_NAME}_USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." ON)
set(git_protocol "git")
if(NOT ${CMAKE_PROJECT_NAME}_USE_GIT_PROTOCOL)
set(git_protocol "http")
# Verify that the global git config has been updated with the expected "insteadOf" option.
function(_check_for_required_git_config_insteadof base insteadof)
execute_process(
COMMAND ${GIT_EXECUTABLE} config --global --get "url.${base}.insteadof"
OUTPUT_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE error_code
)
if(error_code OR NOT "${output}" STREQUAL "${insteadof}")
message(FATAL_ERROR
"Since the ExternalProject modules doesn't provide a mechanism to customize the clone step by "
"adding 'git config' statement between the 'git checkout' and the 'submodule init', it is required "
"to manually update your global git config to successfully build ${CMAKE_PROJECT_NAME} with "
"option ${CMAKE_PROJECT_NAME}_USE_GIT_PROTOCOL set to FALSE. "
"See http://na-mic.org/Mantis/view.php?id=2731"
"\nYou could do so by running the command:\n"
" ${GIT_EXECUTABLE} config --global url.\"${base}\".insteadOf \"${insteadof}\"\n")
endif()
endfunction()
if("${ITK_VERSION_MAJOR}" LESS 4)
_check_for_required_git_config_insteadof("http://itk.org/" "git://itk.org/")
endif()
endif()
#-----------------------------------------------------------------------------
# Qt - Let's check if a valid version of Qt is available
#-----------------------------------------------------------------------------
include(SlicerBlockFindQtAndCheckVersion)
#-----------------------------------------------------------------------------
# Enable and setup External project global properties
#-----------------------------------------------------------------------------
include(ExternalProject)
include(ListToString)
include(SlicerMacroCheckExternalProjectDependency)
set(ep_base "${CMAKE_BINARY_DIR}")
#set(ep_install_dir "${ep_base}/Install")
set(ep_list_separator "^^")
set(ep_common_c_flags "${CMAKE_C_FLAGS_INIT} ${ADDITIONAL_C_FLAGS}")
set(ep_common_cxx_flags "${CMAKE_CXX_FLAGS_INIT} ${ADDITIONAL_CXX_FLAGS}")
# Compute -G arg for configuring external projects with the same CMake generator:
if(CMAKE_EXTRA_GENERATOR)
set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
set(gen "${CMAKE_GENERATOR}")
endif()
#------------------------------------------------------------------------------
# Slicer dependency list
#------------------------------------------------------------------------------
set(ITK_EXTERNAL_NAME ITKv${ITK_VERSION_MAJOR})
set(Slicer_DEPENDENCIES curl teem VTK ${ITK_EXTERNAL_NAME} CTK jqPlot LibArchive)
set(CURL_ENABLE_SSL ${Slicer_USE_PYTHONQT_WITH_OPENSSL})
if(Slicer_USE_OpenIGTLink)
list(APPEND Slicer_DEPENDENCIES OpenIGTLink)
endif()
if(Slicer_BUILD_OpenIGTLinkIF)
list(APPEND Slicer_DEPENDENCIES OpenIGTLinkIF)
endif()
if(Slicer_USE_SimpleITK)
list(APPEND Slicer_DEPENDENCIES SimpleITK)
endif()
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND Slicer_DEPENDENCIES SlicerExecutionModel)
endif()
if(Slicer_BUILD_BRAINSTOOLS)
list(APPEND Slicer_DEPENDENCIES BRAINSTools)
endif()
if(Slicer_BUILD_EMSegment)
list(APPEND Slicer_DEPENDENCIES EMSegment)
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND Slicer_DEPENDENCIES qRestAPI)
endif()
if(Slicer_BUILD_DICOM_SUPPORT)
list(APPEND Slicer_DEPENDENCIES DCMTK)
endif()
if(Slicer_USE_BatchMake)
list(APPEND Slicer_DEPENDENCIES BatchMake)
endif()
if(Slicer_USE_CTKAPPLAUNCHER)
list(APPEND Slicer_DEPENDENCIES CTKAPPLAUNCHER)
endif()
if(Slicer_USE_PYTHONQT)
set(PYTHON_ENABLE_SSL ${Slicer_USE_PYTHONQT_WITH_OPENSSL})
list(APPEND Slicer_DEPENDENCIES python)
endif()
if(Slicer_USE_NUMPY)
list(APPEND Slicer_DEPENDENCIES NUMPY)
endif()
if(Slicer_USE_PYTHONQT_WITH_TCL AND UNIX)
list(APPEND Slicer_DEPENDENCIES incrTcl)
endif()
if(Slicer_BUILD_MultiVolumeExplorer)
list(APPEND Slicer_DEPENDENCIES MultiVolumeExplorer)
endif()
if(Slicer_BUILD_MultiVolumeImporter)
list(APPEND Slicer_DEPENDENCIES MultiVolumeImporter)
endif()
if(Slicer_BUILD_SimpleFilters)
list(APPEND Slicer_DEPENDENCIES SimpleFilters)
endif()
if(Slicer_BUILD_DWIConvert)
list(APPEND Slicer_DEPENDENCIES DWIConvert)
endif()
if(DEFINED Slicer_ADDITIONAL_DEPENDENCIES)
list(APPEND Slicer_DEPENDENCIES ${Slicer_ADDITIONAL_DEPENDENCIES})
endif()
SlicerMacroCheckExternalProjectDependency(Slicer)
#-----------------------------------------------------------------------------
# Dump Slicer external project dependencies
#------------------------------------------------------------------------------
#set(ep_dependency_graph "# External project dependencies")
#foreach(ep ${Slicer_DEPENDENCIES})
# set(ep_dependency_graph "${ep_dependency_graph}\n${ep}:${${ep}_DEPENDENCIES}")
#endforeach()
#file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/SlicerDependencies.txt "${ep_dependency_graph}\n")
#message(STATUS "Generated ${CMAKE_CURRENT_BINARY_DIR}/SlicerDependencies.txt")
#-----------------------------------------------------------------------------
# Define list of additional options used to configure Slicer
#------------------------------------------------------------------------------
set(EXTERNAL_PROJECT_OPTIONAL_ARGS)
foreach(ep_cmake_arg
BUILD_TESTING
BUILD_SHARED_LIBS
WITH_COVERAGE
#WITH_MEMCHECK
Slicer_BUILD_CLI
Slicer_BUILD_CLI_SUPPORT
Slicer_BUILD_DICOM_SUPPORT
Slicer_BUILD_DIFFUSION_SUPPORT
Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
Slicer_BUILD_QTLOADABLEMODULES
Slicer_BUILD_QTSCRIPTEDMODULES
Slicer_BUILD_OpenIGTLinkIF
Slicer_UPDATE_TRANSLATION
Slicer_USE_PYTHONQT
Slicer_USE_PYTHONQT_WITH_OPENSSL
Slicer_USE_PYTHONQT_WITH_TCL
Slicer_USE_CTKAPPLAUNCHER
Slicer_USE_BatchMake
Slicer_USE_MIDAS
Slicer_USE_OpenIGTLink
Slicer_WITH_LIBRARY_VERSION
Slicer_USE_NUMPY
Slicer_USE_QtTesting
Slicer_USE_SimpleITK
Slicer_USE_SimpleITK_SHARED
Slicer_BUILD_BRAINSTOOLS
Slicer_BUILD_EMSegment
Slicer_BUILD_MultiVolumeExplorer
Slicer_BUILD_MultiVolumeImporter
Slicer_PLATFORM_CHECK
)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -D${ep_cmake_arg}:BOOL=${${ep_cmake_arg}})
endforeach()
if(DEFINED CTEST_CONFIGURATION_TYPE)
list_to_string(${ep_list_separator} "${CTEST_CONFIGURATION_TYPE}" ep_CTEST_CONFIGURATION_TYPE)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DCTEST_CONFIGURATION_TYPE:STRING=${ep_CTEST_CONFIGURATION_TYPE})
endif()
if(DEFINED CMAKE_CONFIGURATION_TYPES)
list_to_string(${ep_list_separator} "${CMAKE_CONFIGURATION_TYPES}" ep_CMAKE_CONFIGURATION_TYPES)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DCMAKE_CONFIGURATION_TYPES:STRING=${ep_CMAKE_CONFIGURATION_TYPES})
endif()
if(WIN32)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_SKIP_ROOT_DIR_MAX_LENGTH_CHECK:BOOL=ON)
endif()
if(DEFINED Slicer_ADDITIONAL_REQUIRED_QT_MODULES)
list_to_string(${ep_list_separator} "${Slicer_ADDITIONAL_REQUIRED_QT_MODULES}" ep_Slicer_ADDITIONAL_REQUIRED_QT_MODULES)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_ADDITIONAL_REQUIRED_QT_MODULES:STRING=${ep_Slicer_ADDITIONAL_REQUIRED_QT_MODULES})
endif()
if(Slicer_USE_PYTHONQT)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
)
endif()
if(Slicer_USE_PYTHONQT_WITH_OPENSSL)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DOPENSSL_LIBRARIES:STRING=${OPENSSL_LIBRARIES}
-DOPENSSL_EXPORT_LIBRARY_DIR:PATH=${OPENSSL_EXPORT_LIBRARY_DIR}
-DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
)
if(UNIX)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DOPENSSL_SSL_LIBRARY:STRING=${OPENSSL_SSL_LIBRARY}
-DOPENSSL_CRYPTO_LIBRARY:STRING=${OPENSSL_CRYPTO_LIBRARY}
)
elseif(WIN32)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DLIB_EAY_DEBUG:FILEPATH=${LIB_EAY_DEBUG}
-DLIB_EAY_RELEASE:FILEPATH=${LIB_EAY_RELEASE}
-DSSL_EAY_DEBUG:FILEPATH=${SSL_EAY_DEBUG}
-DSSL_EAY_RELEASE:FILEPATH=${SSL_EAY_RELEASE}
)
endif()
endif()
if(Slicer_USE_PYTHONQT_WITH_TCL)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DSlicer_TCL_DIR:PATH=${tcl_build}
-DTCL_TK_VERSION:STRING=${TCL_TK_VERSION}
-DTCL_TK_VERSION_DOT:STRING=${TCL_TK_VERSION_DOT}
)
if(INCR_TCL_VERSION)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DINCR_TCL_VERSION:STRING=${INCR_TCL_VERSION}
-DINCR_TCL_VERSION_DOT:STRING=${INCR_TCL_VERSION_DOT}
)
endif()
endif()
if(Slicer_USE_SimpleITK)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DSimpleITK_DIR:PATH=${SimpleITK_DIR}
)
endif()
if(Slicer_BUILD_QTLOADABLEMODULES)
# Provide a mechanism to disable one or more loadable modules.
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_QTLOADABLEMODULES_DISABLED:STRING=${Slicer_QTLOADABLEMODULES_DISABLED})
endif()
if(Slicer_BUILD_QTSCRIPTEDMODULES)
# Provide a mechanism to disable one or more scripted modules.
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_QTSCRIPTEDMODULES_DISABLED:STRING=${Slicer_QTSCRIPTEDMODULES_DISABLED})
endif()
if(Slicer_USE_BatchMake)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DBatchMake_DIR:PATH=${BatchMake_DIR})
endif()
if(Slicer_USE_OpenIGTLink)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DOpenIGTLink_DIR:PATH=${OpenIGTLink_DIR})
endif()
if(Slicer_BUILD_OpenIGTLinkIF)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DOpenIGTLinkIF_SOURCE_DIR:PATH=${OpenIGTLinkIF_SOURCE_DIR})
endif()
if(Slicer_USE_CTKAPPLAUNCHER)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DCTKAPPLAUNCHER_DIR:PATH=${CTKAPPLAUNCHER_DIR})
endif()
if(Slicer_BUILD_CLI_SUPPORT)
# Provide a mechanism to disable one or more CLI modules.
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_CLIMODULES_DISABLED:STRING=${Slicer_CLIMODULES_DISABLED})
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicerExecutionModel_DIR:PATH=${SlicerExecutionModel_DIR})
endif()
if(Slicer_BUILD_BRAINSTOOLS)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DBRAINSTools_SOURCE_DIR:PATH=${BRAINSTools_SOURCE_DIR})
endif()
if(Slicer_BUILD_MultiVolumeExplorer)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DMultiVolumeExplorer_SOURCE_DIR:PATH=${MultiVolumeExplorer_SOURCE_DIR})
endif()
if(Slicer_BUILD_MultiVolumeImporter)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DMultiVolumeImporter_SOURCE_DIR:PATH=${MultiVolumeImporter_SOURCE_DIR})
endif()
if(Slicer_BUILD_SimpleFilters)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSimpleFilters_SOURCE_DIR:PATH=${SimpleFilters_SOURCE_DIR})
endif()
if(Slicer_BUILD_EMSegment)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DEMSegment_SOURCE_DIR:PATH=${EMSegment_SOURCE_DIR})
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DqRestAPI_DIR:PATH=${qRestAPI_DIR}
)
endif()
# Projects that Slicer needs to download/configure/build/install...
list(APPEND Slicer_ADDITIONAL_PROJECTS ${Slicer_ADDITIONAL_DEPENDENCIES})
if(Slicer_ADDITIONAL_PROJECTS)
list(REMOVE_DUPLICATES Slicer_ADDITIONAL_PROJECTS)
set(Slicer_ADDITIONAL_PROJECTS_STRING)
foreach(additional_project ${Slicer_ADDITIONAL_PROJECTS})
# needed to do find_package within Slicer
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-D${additional_project}_DIR:PATH=${${additional_project}_DIR})
if(Slicer_ADDITIONAL_PROJECTS_STRING)
set(Slicer_ADDITIONAL_PROJECTS_STRING "${Slicer_ADDITIONAL_PROJECTS_STRING}^^${additional_project}")
else()
set(Slicer_ADDITIONAL_PROJECTS_STRING ${additional_project})
endif()
endforeach()
# needed for packaging
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DSlicer_ADDITIONAL_PROJECTS:STRING=${Slicer_ADDITIONAL_PROJECTS_STRING})
endif()
# Pass variable of the form 'Slicer_USE_SYSTEM_<proj>' allowing to check
# if a project identified by <proj> has been built by Slicer build system or not.
set(Slicer_PROJECTS_STRING)
foreach(ep ${Slicer_DEPENDENCIES})
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DSlicer_USE_SYSTEM_${ep}:BOOL=${Slicer_USE_SYSTEM_${ep}}
)
endforeach()
list_to_string(${ep_list_separator} ${Slicer_DEPENDENCIES} ep_Slicer_DEPENDENCIES)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS -DSlicer_DEPENDENCIES:STRING=${ep_Slicer_DEPENDENCIES})
# Set CMake OSX variable to pass down the external project
if(APPLE)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
endif()
if(DOXYGEN_DOT_FOUND)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DDOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY:PATH=${DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY}
-DDOCUMENTATION_TARGET_IN_ALL:BOOL=${DOCUMENTATION_TARGET_IN_ALL}
)
endif()
if(Slicer_BUILD_DWIConvert)
list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
-DDWIConvert_SOURCE_DIR:PATH=${DWIConvert_SOURCE_DIR}
)
endif()
# message("Slicer External project args:")
# foreach(arg ${EXTERNAL_PROJECT_OPTIONAL_ARGS})
# message(" ${arg}")
# endforeach()
#------------------------------------------------------------------------------
# Configure and build Slicer
#------------------------------------------------------------------------------
set(proj Slicer)
ExternalProject_Add(${proj}
DEPENDS ${Slicer_DEPENDENCIES}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
BINARY_DIR ${Slicer_BINARY_INNER_SUBDIR}
CMAKE_GENERATOR ${gen}
UPDATE_COMMAND ""
LIST_SEPARATOR ${ep_list_separator}
CMAKE_ARGS
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DADDITIONAL_C_FLAGS:STRING=${ADDITIONAL_C_FLAGS}
-DADDITIONAL_CXX_FLAGS:STRING=${ADDITIONAL_CXX_FLAGS}
-DSlicer_REQUIRED_C_FLAGS:STRING=${Slicer_REQUIRED_C_FLAGS}
-DSlicer_REQUIRED_CXX_FLAGS:STRING=${Slicer_REQUIRED_CXX_FLAGS}
-DWITH_COVERAGE:BOOL=${WITH_COVERAGE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DSubversion_SVN_EXECUTABLE:FILEPATH=${Subversion_SVN_EXECUTABLE}
-DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
-DSlicer_SUPERBUILD:BOOL=OFF
-DSlicer_SUPERBUILD_DIR:PATH=${Slicer_BINARY_DIR}
-DSlicer_BUILD_WIN32_CONSOLE:BOOL=${Slicer_BUILD_WIN32_CONSOLE}
-DSlicer_MAIN_PROJECT:STRING=${Slicer_MAIN_PROJECT}
-D${Slicer_MAIN_PROJECT}_APPLICATION_NAME:STRING=${${Slicer_MAIN_PROJECT}_APPLICATION_NAME}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MAJOR:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MAJOR}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MINOR:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MINOR}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_PATCH:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_PATCH}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_TWEAK:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_TWEAK}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_RC:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_RC}
-DSlicer_APPLICATIONS_DIR:PATH=${Slicer_APPLICATIONS_DIR}
-DSlicer_EXTENSION_SOURCE_DIRS:STRING=${Slicer_EXTENSION_SOURCE_DIRS}
-DDOXYGEN_EXECUTABLE:FILEPATH=${DOXYGEN_EXECUTABLE}
${EXTERNAL_PROJECT_OPTIONAL_ARGS}
# Qt
-DSlicer_USE_SYSTEM_QT:BOOL=${Slicer_USE_SYSTEM_QT}
# ITK
-DITK_VERSION_MAJOR:STRING=${ITK_VERSION_MAJOR}
-DITK_DIR:PATH=${ITK_DIR}
# Teem
-DTeem_DIR:PATH=${Teem_DIR}
# VTK
-DVTK_DIR:PATH=${VTK_DIR}
-DVTK_DEBUG_LEAKS:BOOL=${Slicer_USE_VTK_DEBUG_LEAKS}
# CURL
-DCURL_INCLUDE_DIR:PATH=${CURL_INCLUDE_DIR}
-DCURL_LIBRARY:PATH=${CURL_LIBRARY}
# Qt
-DSlicer_REQUIRED_QT_VERSION:STRING=${Slicer_REQUIRED_QT_VERSION}
-DQT_QMAKE_EXECUTABLE:PATH=${QT_QMAKE_EXECUTABLE}
# CTK
-DCTK_DIR:PATH=${CTK_DIR}
# DCMTK
-DDCMTK_DIR:PATH=${DCMTK_DIR}
-DDCMTK_INCLUDE_DIRS:STRING=${DCMTK_INCLUDE_DIRS}
-DDCMTK_LIBRARIES:STRING=${DCMTK_LIBRARIES}
# jqPlot
-DjqPlot_DIR:PATH=${jqPlot_DIR}
# LibArchive
-DLibArchive_DIR:PATH=${LibArchive_DIR}
-DLibArchive_INCLUDE_DIR:PATH=${LibArchive_INCLUDE_DIR}
-DLibArchive_LIBRARY:FILEPATH=${LibArchive_LIBRARY}
# zlib
-DZLIB_ROOT:PATH=${ZLIB_ROOT}
-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}
-DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY}
INSTALL_COMMAND ""
)
# This custom external project step forces the build and later
# steps to run whenever a top level build is done...
ExternalProject_Add_Step(${proj} forcebuild
COMMAND ${CMAKE_COMMAND} -E echo_append ""
COMMENT "Forcing build step for '${proj}'"
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)
#-----------------------------------------------------------------------------
# Slicer extensions
#-----------------------------------------------------------------------------
add_subdirectory(Extensions/CMake)