forked from medInria/medinria-superproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (35 loc) · 1.57 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
if (DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel.")
else()
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel.")
endif()
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/externals"
"${CMAKE_CURRENT_SOURCE_DIR}/medInria/cmake"
${CMAKE_MODULE_PATH})
project(medinria-full)
include(ExternalProjects)
include(CheckEnvironment)
set(MEDINRIA_TEST_DATA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/medInria-testdata)
set(packages Qt dtk VTK ITK dcmtk TTK QtDcm RPI medInria)
# This adds global targets that run this step in every subproject
set(global_targets configure update build install)
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS ${global_targets})
foreach (target ${global_targets})
add_custom_target(${target})
endforeach()
# There are three possibilities:
# - if the option USE_SYSTEM_${PACKAGE} is set, then the system version will be used (not yet tested)
# - if the option USE_SYSTEM_${PACKAGE} is not set:
# o if there is a subdir with the package name, in which case this subdir is used directly
# o otherwise use download and compile locally the package as an external module.
foreach (package ${packages})
call(${package}_project)
foreach (target ${global_targets})
add_dependencies(${target} ${package}-${target})
endforeach()
endforeach()