forked from smistad/Tube-Segmentation-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
133 lines (111 loc) · 4.35 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
122
123
124
125
126
127
128
129
130
131
132
133
###########################################################
## Tube-Segmentation-Framework project
###########################################################
project(Tube-Segmentation-Framework)
cmake_minimum_required(VERSION 2.8)
#------------------------------------------------------------------------------
# Set compiler flags
#------------------------------------------------------------------------------
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3")
endif(NOT WIN32)
option(USE_C++11 "use C++11 (Tube-Segmentation-Framework)" ON) # cmake option to use boost libraries instead of C++11
if(USE_C++11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D CPP11 -std=c++0x")
endif()
#------------------------------------------------------------------------------
# External libraries
#------------------------------------------------------------------------------
option (TSF_USE_EXTRNAL_OUL "Use external OpenCLUtilityLibrary" OFF)
option (TSF_EXTERNAL_OUL_PATH "Path to external OpenCLUtilityLibrary build" "")
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/CMake
)
include(tsfInitializeLibraries)
tsf_initialize_external_libraries()
#------------------------------------------------------------------------------
# Where to look for includes and libraries
#------------------------------------------------------------------------------
include_directories(${Boost_INCLUDE_DIRS} ${PROJECT_BINARY_DIR})
link_directories(${Boost_LIBRARY_DIRS})
#------------------------------------------------------------------------------
# Targets
#------------------------------------------------------------------------------
#
# tubeSegmentationLib library
###########
add_library(tubeSegmentationLib
tube-segmentation.cpp
parameters.cpp
gradientVectorFlow.cpp
tubeDetectionFilters.cpp
ridgeTraversalCenterlineExtraction.cpp
eigenanalysisOfHessian.cpp
globalCenterlineExtraction.cpp
parallelCenterlineExtraction.cpp
inputOutput.cpp
segmentation.cpp
)
target_link_libraries(tubeSegmentationLib OpenCLUtilityLibrary SIPL ${Boost_LIBRARIES} ${OPENCL_LIBRARIES})
#
# tubeSegmentation executable
###########
option(SIPL_USE_GTK "Use SIPL with GTK" ON)
if(SIPL_USE_GTK)
add_executable(tubeSegmentation
main.cpp
tube-segmentation.cpp
parameters.cpp
gradientVectorFlow.cpp
tubeDetectionFilters.cpp
ridgeTraversalCenterlineExtraction.cpp
eigenanalysisOfHessian.cpp
globalCenterlineExtraction.cpp
parallelCenterlineExtraction.cpp
inputOutput.cpp
segmentation.cpp
)
target_link_libraries(tubeSegmentation SIPL OpenCLUtilityLibrary ${Boost_LIBRARIES} ${OPENCL_LIBRARIES})
endif()
#------------------------------------------------------------------------------
# Testing
#------------------------------------------------------------------------------
tsf_enable_testing()
#------------------------------------------------------------------------------
# Set variables
#------------------------------------------------------------------------------
set(PARAMETERS_DIR ${PROJECT_SOURCE_DIR}/parameters)
set(KERNELS_DIR ${PROJECT_SOURCE_DIR})
set(TESTDATA_DIR ${PROJECT_SOURCE_DIR}/tests/data)
if(TSF_USE_EXTRNAL_OUL)
set(OUL_DIR ${OpenCLUtilityLibrary_SOURCE_DIR})
else(TSF_USE_EXTRNAL_OUL)
set(OUL_DIR ${PROJECT_SOURCE_DIR}/OpenCLUtilityLibrary)
endif(TSF_USE_EXTRNAL_OUL)
#------------------------------------------------------------------------------
# Configure file for find_package module
#------------------------------------------------------------------------------
set( Tube-Segmentation-Framework_MODULE_PATH
${Tube-Segmentation-Framework_SOURCE_DIR}/CMake
)
set( Tube-Segmentation-Framework_INCLUDE_DIRS
${Tube-Segmentation-Framework_SOURCE_DIR}
)
set(Tube-Segmentation-Framework_LIBRARY_DIRS
${Tube-Segmentation-Framework_BINARY_DIR}
${OCL-Utilities_LIBRARY_DIRS}
${SIPL_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
)
configure_file(
"${PROJECT_SOURCE_DIR}/CMake/Tube-Segmentation-FrameworkConfig.cmake.in"
"${PROJECT_BINARY_DIR}/Tube-Segmentation-FrameworkConfig.cmake"
)
#------------------------------------------------------------------------------
# Configure file for settings, filepaths, parameters ...
#------------------------------------------------------------------------------
configure_file(
"${PROJECT_SOURCE_DIR}/CMake/tsf-config.h.in"
"${PROJECT_BINARY_DIR}/tsf-config.h"
)