-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
205 lines (172 loc) · 9.17 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
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
project("ebbrt-fetal-reconstruction" C CXX)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O4 -flto -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -Werror -DHAS_NIFTI -DHAS_TBB -Wno-unused-but-set-variable -Wno-unused-result -Wno-unused-label -Wno-unused-function -DHAVE_INLINE")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -Werror -DHAS_NIFTI -DHAS_TBB -D__MNODE__ -DHAVE_INLINE")
set(IRTK_SOURCE_DIR IRTKSimple2/)
set(IRTK_IMAGE_SRC
IRTKSimple2/image++/src/irtkGenericImage.cc
IRTKSimple2/image++/src/irtkBaseImage.cc
IRTKSimple2/image++/src/irtkImageToFile.cc
IRTKSimple2/image++/src/irtkImageToFileGIPL.cc
IRTKSimple2/image++/src/irtkImageToFileVTK.cc
IRTKSimple2/image++/src/irtkImageToFilePGM.cc
IRTKSimple2/image++/src/irtkImageToFileANALYZE.cc
IRTKSimple2/image++/src/irtkImageToFileNIFTI.cc
IRTKSimple2/image++/src/irtkFileToImage.cc
IRTKSimple2/image++/src/irtkFileGIPLToImage.cc
IRTKSimple2/image++/src/irtkFileNIFTIToImage.cc
IRTKSimple2/image++/src/irtkFileANALYZEToImage.cc
IRTKSimple2/image++/src/irtkFileVTKToImage.cc
IRTKSimple2/image++/src/irtkFilePGMToImage.cc
IRTKSimple2/image++/src/irtkHistogram_2D.cc
IRTKSimple2/image++/src/irtkHistogram_1D.cc
IRTKSimple2/image++/src/irtkResamplingWithPadding.cc
IRTKSimple2/image++/src/irtkNearestNeighborInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkGaussianBlurring.cc
IRTKSimple2/image++/src/irtkResampling.cc
IRTKSimple2/image++/src/irtkImageToImage.cc
IRTKSimple2/image++/src/irtkInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkLinearInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkGaussianBlurringWithPadding.cc
IRTKSimple2/image++/src/irtkScalarFunctionToImage.cc
IRTKSimple2/image++/src/irtkConvolution.cc
IRTKSimple2/image++/src/irtkImageFunction.cc
IRTKSimple2/image++/src/irtkConvolution_1D.cc
IRTKSimple2/image++/src/irtkSincInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkGaussianInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkBSplineInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkCSplineInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkShapeBasedInterpolateImageFunction.cc
IRTKSimple2/image++/src/irtkSincInterpolateImageFunction2D.cc
IRTKSimple2/image++/src/irtkNearestNeighborInterpolateImageFunction2D.cc
IRTKSimple2/image++/src/irtkGaussianInterpolateImageFunction2D.cc
IRTKSimple2/image++/src/irtkBSplineInterpolateImageFunction2D.cc
IRTKSimple2/image++/src/irtkCSplineInterpolateImageFunction2D.cc
IRTKSimple2/image++/src/irtkConvolutionWithPadding_1D.cc
IRTKSimple2/image++/src/irtkLinearInterpolateImageFunction2D.cc
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
IRTKSimple2/image++/src/
)
set(IRTK_COMMON_SRC
IRTKSimple2/common++/src/irtkObject.cc
IRTKSimple2/common++/src/irtkCifstream.cc
IRTKSimple2/common++/src/irtkCofstream.cc
IRTKSimple2/common++/src/swap.cc
IRTKSimple2/common++/src/basename.cc
)
set(IRTK_CONTRIB_SRC IRTKSimple2/contrib++/src)
set(IRTK_GEOMETRY_SRC
IRTKSimple2/geometry++/src/irtkMatrix.cc
IRTKSimple2/geometry++/src/irtkPointSet.cc
IRTKSimple2/geometry++/src/irtkVector.cc
IRTKSimple2/geometry++/src/irtkScalarGaussian.cc
IRTKSimple2/geometry++/src/irtkScalarFunction.cc
)
set(IRTK_REGISTRATION_SRC
IRTKSimple2/packages/registration/src/irtkImageRigidRegistrationWithPadding.cc
IRTKSimple2/packages/registration/src/irtkImageRegistration.cc
IRTKSimple2/packages/registration/src/irtkImageRegistrationWithPadding.cc
IRTKSimple2/packages/registration/src/irtkUtil.cc
IRTKSimple2/packages/registration/src/irtkOptimizer.cc
IRTKSimple2/packages/registration/src/irtkSteepestGradientDescentOptimizer.cc
IRTKSimple2/packages/registration/src/irtkGradientDescentOptimizer.cc
IRTKSimple2/packages/registration/src/irtkDownhillDescentOptimizer.cc
IRTKSimple2/packages/registration/src/irtkConjugateGradientDescentOptimizer.cc
IRTKSimple2/packages/registration/src/irtkGradientDescentConstrainedOptimizer.cc
)
set(IRTK_TRANSFORMATION_SRC
IRTKSimple2/packages/transformation/src/irtkTransformation.cc
IRTKSimple2/packages/transformation/src/irtkTemporalHomogeneousTransformation.cc
IRTKSimple2/packages/transformation/src/irtkRigidTransformation.cc
IRTKSimple2/packages/transformation/src/irtkAffineTransformation.cc
IRTKSimple2/packages/transformation/src/irtkTemporalAffineTransformation.cc
IRTKSimple2/packages/transformation/src/irtkHomogeneousTransformation.cc
IRTKSimple2/packages/transformation/src/irtkTemporalRigidTransformation.cc
IRTKSimple2/packages/transformation/src/irtkImageTransformation.cc
IRTKSimple2/packages/transformation/src/irtkImageHomogeneousTransformation.cc
IRTKSimple2/packages/transformation/src/
IRTKSimple2/packages/transformation/src/
IRTKSimple2/packages/transformation/src/
IRTKSimple2/packages/transformation/src/
)
set(IRTK_NIFTI_SRC
IRTKSimple2/nifti/niftilib/nifti1_io.c
)
set(IRTK_ZNZ_SRC
IRTKSimple2/nifti/znzlib/znzlib.c
)
set(BAREMETAL_SOURCES
src/irtkReconstructionEbb.cc
)
set(BAREMETAL_INCLUDES
src
)
set(HOSTED_SOURCES
src/reconstruction.cc
src/irtkReconstructionEbb.cc
)
set(EXT
ext/
)
set(EXT_LIBS
)
# Baremetal ========================================================
if( ${CMAKE_SYSTEM_NAME} STREQUAL "EbbRT")
message(STATUS "### BUILDING NATIVE ###")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -Werror -Wno-unused-local-typedefs -Wno-unused-label -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-deprecated -DHAS_NIFTI -DHAVE_INLINE -D__MNODE__ -D__EBBRT_BM__")
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/common++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/geometry++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/image++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/contrib++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/transformation/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/registration/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/nifti/niftilib)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/nifti/znzlib)
INCLUDE_DIRECTORIES(${EXT})
include_directories(${BAREMETAL_INCLUDES})
add_executable(reconstruction.elf ${BAREMETAL_SOURCES} ${IRTK_IMAGE_SRC} ${IRTK_COMMON_SRC} ${IRTK_GEOMETRY_SRC} ${IRTK_contrib_SRC} ${IRTK_NIFTI_SRC} ${IRTK_ZNZ_SRC} ${IRTK_TRANSFORMATION_SRC} ${IRTK_REGISTRATION_SRC})
target_link_libraries(reconstruction.elf ${CMAKE_SOURCE_DIR}/libs/libboost_serialization.a ${CMAKE_SOURCE_DIR}/libs/libboost_system.a ${CMAKE_SOURCE_DIR}/libs/libboost_wserialization.a ${CMAKE_SOURCE_DIR}/libs/libgsl.a ${CMAKE_SOURCE_DIR}/libs/libgslcblas.a)
add_custom_command(TARGET reconstruction.elf POST_BUILD
COMMAND objcopy -O elf32-i386 reconstruction.elf reconstruction.elf32 )
elseif( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
message(STATUS "########################### BUILDING HOSTED LINUX #########################")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -Werror -D__EBB__ -DHAS_NIFTI -DHAS_TBB -DHAVE_INLINE -D__MNODE__ -Wno-unused-but-set-variable -Wno-unused-result -Wno-unused-label -Wno-unused-function")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -Werror -D__EBB__ -DHAS_NIFTI -DHAS_TBB -DHAVE_INLINE -Wno-unused-but-set-variable -Wno-unused-result -Wno-unused-label -Wno-unused-function")
find_package(EbbRT REQUIRED)
find_package(Boost 1.53.0 REQUIRED COMPONENTS
filesystem system coroutine context program_options)
find_package(Capnp REQUIRED)
find_package(TBB REQUIRED)
find_package(Threads REQUIRED)
FIND_PACKAGE(GSL REQUIRED)
include_directories(${GSL_INCLUDE_DIRS} ${GSLCBLAS_INCLUDE_DIRS})
#set(GSLLIBS ${LIBS} ${GSL_LIBRARIES} ${GSLCBLAS_LIBRARIES})
#SUBDIRS(${IRTK_SOURCE_DIR}/common++/src ${IRTK_SOURCE_DIR}/geometry++/src ${IRTK_SOURCE_DIR}/image++/src ${IRTK_SOURCE_DIR}/contrib++/src ${IRTK_SOURCE_DIR}/packages)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/common++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/geometry++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/image++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/contrib++/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/transformation/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/registration/include)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/nifti/niftilib)
INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/nifti/znzlib)
include_directories(${EBBRT_INCLUDE_DIRS})
add_executable(reconstruction ${HOSTED_SOURCES} ${IRTK_IMAGE_SRC} ${IRTK_COMMON_SRC} ${IRTK_GEOMETRY_SRC} ${IRTK_contrib_SRC} ${IRTK_NIFTI_SRC} ${IRTK_ZNZ_SRC} ${IRTK_TRANSFORMATION_SRC} ${IRTK_REGISTRATION_SRC})
target_link_libraries(reconstruction
${EBBRT_LIBRARIES} ${CAPNP_LIBRARIES_LITE} ${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES} ${TBB_LIBRARIES} ${GSL_LIBRARIES}
)
else()
message(FATAL_ERROR "System name unsupported: ${CMAKE_SYSTEM_NAME}")
endif()