-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
76 lines (65 loc) · 2.28 KB
/
CMakeLists.txt
File metadata and controls
76 lines (65 loc) · 2.28 KB
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
cmake_minimum_required(VERSION 3.16.3)
project(LesionSizingToolkit)
if(NOT ITK_SOURCE_DIR)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
include(ITKModuleExternal)
else()
itk_module_impl()
endif()
option(LSTK_USE_VTK "Build visualization helper tools." OFF)
if(LSTK_USE_VTK)
if(NOT COMMAND vtk_module_config)
macro(vtk_module_config ns)
foreach(arg ${ARGN})
if(${arg} MATCHES "^[Vv][Tt][Kk]")
string(REGEX REPLACE "^[Vv][Tt][Kk]" "" _arg ${arg})
else()
set(_arg ${arg})
endif()
set(${ns}_LIBRARIES ${${ns}_LIBRARIES} VTK::${_arg})
endforeach()
endmacro()
if(NOT VTK_RENDERING_BACKEND)
set(VTK_RENDERING_BACKEND OpenGL2)
endif()
endif()
if(NOT VTK_RENDERING_BACKEND)
if(NOT COMMAND vtk_module_config)
set(VTK_RENDERING_BACKEND OpenGL2)
else()
set(VTK_RENDERING_BACKEND OpenGL)
endif()
endif()
set(_target_freetypeopengl)
if(TARGET ${_target_prefix}RenderingFreeType${VTK_RENDERING_BACKEND})
set(_target_freetypeopengl ${_target_prefix}RenderingFreeType${VTK_RENDERING_BACKEND})
endif()
set(_required_vtk_libraries
${_target_prefix}RenderingVolume
#${_target_prefix}Rendering${VTK_RENDERING_BACKEND}
${_target_prefix}IOGeometry
${_target_prefix}IOLegacy
${_target_prefix}IOImage
${_target_prefix}InteractionWidgets
${_target_prefix}InteractionImage
)
vtk_module_config(ITK_VTK_LSTK
${_required_vtk_libraries}
)
set(ITK_VTK_LSTK_LIBRARIES ${LesionSizingToolkit_LIBRARIES} ${_required_vtk_libraries})
# The VTK DICOMParser and vtkmetaio includes conflict with the ITK
# versions. Here we remove them from the include directories.
#
string(REGEX REPLACE "[^;]*MetaIO;"
"" ITK_VTK_LSTK_INCLUDE_DIRS "${ITK_VTK_LSTK_INCLUDE_DIRS}")
string(REGEX REPLACE "[^;]*vtkmetaio;"
"" ITK_VTK_LSTK_INCLUDE_DIRS "${ITK_VTK_LSTK_INCLUDE_DIRS}")
string(REGEX REPLACE "[^;]*DICOMParser;"
"" ITK_VTK_LSTK_INCLUDE_DIRS "${ITK_VTK_LSTK_INCLUDE_DIRS}")
# Add preprocessor definitions needed to use VTK.
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${ITK_VTK_LSTK_VTK_DEFINITIONS})
add_subdirectory(Examples)
add_subdirectory(Utilities)
endif()