forked from Slicer/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
121 lines (108 loc) · 4.43 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
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
project(SlicerLibs)
# Enable this option to avoid unnecessary re-compilation associated with command line module
set(GENERATECLP_USE_MD5 ON)
#set(IGT_USE_IGSTK ${Slicer_USE_IGSTK})
#set(IGT_USE_NAVITRACK ${Slicer_USE_NAVITRACK})
# --------------------------------------------------------------------------
# ----] W A R N I N G [----
# --------------------------------------------------------------------------
# Order of project directory matters. Project should be topologically ordered
# --------------------------------------------------------------------------
set(dirs
vtkTeem
vtkITK
FreeSurfer
MRML/Core
)
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND dirs MRML/CLI)
endif()
list(APPEND dirs
RemoteIO
MRML/Logic
MRML/DisplayableManager
)
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND dirs MRML/IDImageIO)
endif()
list(APPEND dirs
MGHImageIO
# IGT
MRML/Widgets
)
#-----------------------------------------------------------------------------
# Set library properties
#-----------------------------------------------------------------------------
if(Slicer_BUILD_CLI_SUPPORT)
# Python support within ModuleDescriptionParser is used only within ModuleFactory.cxx
# Considering the ModuleFactory isn't used anymore to discover modules, let's disable the
# associated python support so that the python library aren't a dependency of
# either ModuleDescriptionParser or program/library depending on ModuleDescriptionParser.
set(ModuleDescriptionParser_USE_PYTHON OFF)
endif()
# ITKFactories directories
set(MGHImageIO_ITKFACTORIES_DIR ${Slicer_ITKFACTORIES_DIR})
set(MGHImageIO_INSTALL_ITKFACTORIES_DIR ${Slicer_INSTALL_ITKFACTORIES_DIR})
set(MRMLIDImageIO_ITKFACTORIES_DIR ${Slicer_ITKFACTORIES_DIR})
set(MRMLIDImageIO_INSTALL_ITKFACTORIES_DIR ${Slicer_INSTALL_ITKFACTORIES_DIR})
# vtkITK contains tests that uses MRML's test data.
set(MRML_TEST_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MRML/Core/Testing/TestData)
#-----------------------------------------------------------------------------
# Loop over list of directories
#-----------------------------------------------------------------------------
foreach(dir ${dirs})
message(STATUS "Configuring library: ${dir}")
string(REPLACE "/" "" dir_noslash ${dir})
if(dir_noslash MATCHES "Widgets$")
set(dir_noslash "q${dir_noslash}")
endif()
set(${dir_noslash}_INSTALL_BIN_DIR ${Slicer_INSTALL_LIB_DIR})
set(${dir_noslash}_INSTALL_LIB_DIR ${Slicer_INSTALL_LIB_DIR})
set(${dir_noslash}_INSTALL_SHARE_DIR ${Slicer_INSTALL_ROOT}share/${dir_noslash})
set(${dir_noslash}_INSTALL_NO_DEVELOPMENT ${Slicer_INSTALL_NO_DEVELOPMENT})
set(${dir_noslash}_EXPORT_FILE ${Slicer_BINARY_DIR}/SlicerTargets.cmake)
add_subdirectory(${dir})
endforeach()
#-----------------------------------------------------------------------------
# Generate list of include directories
#-----------------------------------------------------------------------------
set(include_dirs)
foreach(dir ${dirs})
string(REPLACE "/" "" dir_noslash ${dir})
if(dir_noslash MATCHES "Widgets$")
set(dir_noslash "q${dir_noslash}")
endif()
list(APPEND include_dirs ${${dir_noslash}_INCLUDE_DIRS})
endforeach()
# Set variable Slicer_Libs_INCLUDE_DIRS
set(Slicer_Libs_INCLUDE_DIRS ${include_dirs} CACHE INTERNAL "Slicer Libs includes" FORCE)
#-----------------------------------------------------------------------------
# Set MRML_LIBRARIES
#-----------------------------------------------------------------------------
# Anticipating the move of MRML related libraries to a standalone project,
# let's group these libraries.
# Note also that since MRMLIDImageIO is an ITK plugin it is NOT added to that list.
set(_mrml_libraries MRMLCore MRMLLogic MRMLDisplayableManager)
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND _mrml_libraries MRMLCLI)
endif()
set(MRML_LIBRARIES ${_mrml_libraries} CACHE INTERNAL "MRML libraries" FORCE)
#-----------------------------------------------------------------------------
# Set variable Slicer_Libs_VTK_WRAPPED_LIBRARIES
#-----------------------------------------------------------------------------
set(_vtk_wrapped_libraries
vtkTeem
vtkITK
FreeSurfer
MRMLCore
MRMLLogic
RemoteIO
)
if(Slicer_USE_PYTHONQT AND VTK_WRAP_PYTHON)
list(APPEND _vtk_wrapped_libraries MRMLDisplayableManager)
endif()
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND _vtk_wrapped_libraries MRMLCLI)
endif()
set(Slicer_Libs_VTK_WRAPPED_LIBRARIES
${_vtk_wrapped_libraries} CACHE INTERNAL "Slicer Libs VTK wrapped" FORCE)