-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCMakeLists.txt
305 lines (242 loc) · 5.73 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
cmake_minimum_required(VERSION 2.8)
add_definitions(-std=c++11)
project( calibration )
find_package( OpenCV REQUIRED )
FIND_PACKAGE( Ceres REQUIRED )
find_package( Boost COMPONENTS program_options REQUIRED )
#find_package( Eigen3 REQUIRED )
include_directories(${EIGEN3_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIR})
include_directories(include)
### LIB COMPILATION ###
#fisheye simulation
#TODO add multi-camera system
add_library( render STATIC
src/render/render.cpp
src/render/plane.cpp
src/render/background.cpp
src/render/texture.cpp
src/render/aa_filter_lt.cpp
)
target_link_libraries( render
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_library( calibration STATIC
src/calibration/corner_detector.cpp
src/calibration/unified_calibration.cpp
src/calibration/calib_cost_functions.cpp
src/calibration/trajectory_generation.cpp
src/calibration/odometry_cost_function.cpp
)
target_link_libraries( calibration
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_library( reconstruction STATIC
src/reconstruction/eucm_sgm.cpp
src/reconstruction/eucm_stereo.cpp
src/reconstruction/eucm_motion_stereo.cpp
src/reconstruction/eucm_epipolar.cpp
src/reconstruction/depth_map.cpp
src/reconstruction/triangulator.cpp
src/reconstruction/scale_parameters.cpp
src/reconstruction/epipoles.cpp
)
target_link_libraries( reconstruction ${OpenCV_LIBS} )
add_library( localization STATIC
src/localization/photometric.cpp
src/localization/local_cost_functions.cpp
src/localization/cost_function_mi.cpp
src/localization/mono_odom.cpp
src/localization/sparse_odom.cpp
src/localization/mapping.cpp
)
TARGET_LINK_LIBRARIES( localization
reconstruction
${OpenCV_LIBS}
${CERES_LIBRARIES}
)
### CALIBRATION ###
add_executable( calib
test/calibration/generic_calibration.cpp
)
target_link_libraries( calib
calibration
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_executable( rectify
test/calibration/rectify.cpp
)
target_link_libraries( rectify
calibration
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_executable( odom_interpolation
test/calibration/odometry_interpolation.cpp
)
target_link_libraries( odom_interpolation
${Boost_LIBRARIES}
)
add_executable( stereo_sync
test/calibration/stereo_sync.cpp
)
target_link_libraries( stereo_sync
${Boost_LIBRARIES}
)
add_executable( optim_trajectory
test/calibration/trajectory.cpp
)
target_link_libraries( optim_trajectory
calibration
${CERES_LIBRARIES}
)
add_executable(board_detector
test/calibration/board_detector.cpp
)
target_link_libraries( board_detector
calibration
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
### RECONSTRUCTION ###
add_executable( hough_test
test/reconstruction/hough_test.cpp
)
target_link_libraries( hough_test
${OpenCV_LIBS}
reconstruction
)
add_executable( dense_ba_test
test/reconstruction/dense_ba_test.cpp
)
target_link_libraries( dense_ba_test
${OpenCV_LIBS}
reconstruction
render
localization
)
add_executable( equalizer_test
test/reconstruction/equalizer_test.cpp
)
target_link_libraries( equalizer_test
${OpenCV_LIBS}
)
add_executable( renderer_test
test/reconstruction/renderer_test.cpp
)
target_link_libraries( renderer_test
render
reconstruction
${OpenCV_LIBS}
)
add_executable( epipolar
test/reconstruction/epipolar_trace.cpp
)
target_link_libraries( epipolar
reconstruction
${OpenCV_LIBS}
)
add_executable( descriptor_step
test/reconstruction/descriptor_step.cpp
)
target_link_libraries( descriptor_step
reconstruction
${OpenCV_LIBS}
)
add_executable( stereo_test
test/reconstruction/stereo_test.cpp
)
target_link_libraries( stereo_test
reconstruction
render
${OpenCV_LIBS}
)
add_executable( stereo_single_pair
test/reconstruction/stereo_single_pair.cpp
)
target_link_libraries( stereo_single_pair
reconstruction
${OpenCV_LIBS}
)
add_executable( stereo_flow
test/reconstruction/stereo_flow_test.cpp
)
target_link_libraries( stereo_flow
reconstruction
${OpenCV_LIBS}
)
## LOCALIZATION ###
add_executable( mapping
test/localization/map_test.cpp
)
target_link_libraries( mapping
reconstruction
localization
render
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_executable( map_real_data
test/localization/map_real_data.cpp
)
target_link_libraries( map_real_data
reconstruction
localization
render
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_executable( odometry_test
test/localization/mono_odom_test.cpp
)
target_link_libraries( odometry_test
reconstruction
localization
render
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_executable( sparse_odom_test
test/localization/sparse_odom_test.cpp
)
target_link_libraries( sparse_odom_test
localization
${OpenCV_LIBS}
${CERES_LIBRARIES}
${Boost_LIBRARIES}
)
add_executable( photometric
test/localization/photometric_test.cpp
)
target_link_libraries( photometric
reconstruction
localization
${OpenCV_LIBS}
${CERES_LIBRARIES}
)
add_executable( mi_test
test/localization/mi_test.cpp
)
target_link_libraries( mi_test
reconstruction
localization
${OpenCV_LIBS}
${CERES_LIBRARIES}
)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-Wno-deprecated -O2") ## Optimize
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
# set(CMAKE_CXX_FLAGS "-Wno-deprecated -ggdb") # DEBUG
endif()