-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
220 lines (187 loc) · 5.88 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
cmake_minimum_required(VERSION 3.4)
project(omni_slam_eval)
set(CMAKE_VERBOSE_MAKEFILE FALSE)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif (NOT CMAKE_BUILD_TYPE)
# find catkin dependencies
set(REQ_CATKIN_PKGS
roscpp
cv_bridge
sensor_msgs
image_transport
pcl_ros
tf2_ros
rosbag
)
find_package(catkin REQUIRED COMPONENTS ${REQ_CATKIN_PKGS})
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
find_package(OpenCV 4.1 REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARIES_DIRS})
find_package(PCL 1.7 REQUIRED COMPONENTS common)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
find_package(Ceres REQUIRED)
include_directories(${Ceres_INCLUDE_DIRS})
find_package(HDF5 COMPONENTS C CXX HL REQUIRED)
include_directories(${HDF5_INCLUDE_DIR})
link_directories(${HDF5_LIBRARY_DIRS})
find_package(OpenMP REQUIRED)
catkin_package(
INCLUDE_DIRS src
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS ${REQ_CATKIN_PKGS}
DEPENDS
)
include_directories(
src
${catkin_INCLUDE_DIRS}
)
add_library(omni_slam_eval_lib
src/module/tracking_module.cc
src/module/matching_module.cc
src/module/stereo_module.cc
src/module/reconstruction_module.cc
src/module/odometry_module.cc
src/data/frame.cc
src/data/feature.cc
src/data/landmark.cc
src/feature/tracker.cc
src/feature/lk_tracker.cc
src/feature/descriptor_tracker.cc
src/feature/detector.cc
src/feature/matcher.cc
src/reconstruction/triangulator.cc
src/odometry/pose_estimator.cc
src/odometry/pnp.cc
src/odometry/five_point.cc
src/optimization/bundle_adjuster.cc
src/stereo/stereo_matcher.cc
src/stereo/lk_stereo_matcher.cc
src/util/hdf_file.cc
)
add_executable(omni_slam_tracking_eval_node
src/ros/tracking_eval.cc
src/ros/eval_base.cc
src/omni_slam_tracking_eval_node.cc
)
add_executable(omni_slam_matching_eval_node
src/ros/matching_eval.cc
src/ros/eval_base.cc
src/omni_slam_matching_eval_node.cc
)
add_executable(omni_slam_reconstruction_eval_node
src/ros/reconstruction_eval.cc
src/ros/tracking_eval.cc
src/ros/eval_base.cc
src/omni_slam_reconstruction_eval_node.cc
)
add_executable(omni_slam_odometry_eval_node
src/ros/odometry_eval.cc
src/ros/tracking_eval.cc
src/ros/eval_base.cc
src/omni_slam_odometry_eval_node.cc
)
add_executable(omni_slam_stereo_eval_node
src/ros/stereo_eval.cc
src/ros/tracking_eval.cc
src/ros/eval_base.cc
src/omni_slam_stereo_eval_node.cc
)
add_executable(omni_slam_slam_eval_node
src/ros/slam_eval.cc
src/ros/stereo_eval.cc
src/ros/odometry_eval.cc
src/ros/reconstruction_eval.cc
src/ros/tracking_eval.cc
src/ros/eval_base.cc
src/omni_slam_slam_eval_node.cc
)
target_link_libraries(omni_slam_tracking_eval_node PUBLIC omni_slam_eval_lib
${catkin_LIBRARIES}
${OpenCV_LIBS}
${HDF5_CXX_LIBRARIES}
${OpenMP_CXX_FLAGS}
${PCL_LIBRARIES}
${CERES_LIBRARIES}
)
target_link_libraries(omni_slam_matching_eval_node PUBLIC omni_slam_eval_lib
${catkin_LIBRARIES}
${OpenCV_LIBS}
${HDF5_CXX_LIBRARIES}
${OpenMP_CXX_FLAGS}
${PCL_LIBRARIES}
${CERES_LIBRARIES}
)
target_link_libraries(omni_slam_reconstruction_eval_node PUBLIC omni_slam_eval_lib
${catkin_LIBRARIES}
${OpenCV_LIBS}
${HDF5_CXX_LIBRARIES}
${OpenMP_CXX_FLAGS}
${PCL_LIBRARIES}
${CERES_LIBRARIES}
)
target_link_libraries(omni_slam_odometry_eval_node PUBLIC omni_slam_eval_lib
${catkin_LIBRARIES}
${OpenCV_LIBS}
${HDF5_CXX_LIBRARIES}
${OpenMP_CXX_FLAGS}
${PCL_LIBRARIES}
${CERES_LIBRARIES}
)
target_link_libraries(omni_slam_stereo_eval_node PUBLIC omni_slam_eval_lib
${catkin_LIBRARIES}
${OpenCV_LIBS}
${HDF5_CXX_LIBRARIES}
${OpenMP_CXX_FLAGS}
${PCL_LIBRARIES}
${CERES_LIBRARIES}
)
target_link_libraries(omni_slam_slam_eval_node PUBLIC omni_slam_eval_lib
${catkin_LIBRARIES}
${OpenCV_LIBS}
${HDF5_CXX_LIBRARIES}
${OpenMP_CXX_FLAGS}
${PCL_LIBRARIES}
${CERES_LIBRARIES}
)
target_compile_options(omni_slam_tracking_eval_node PUBLIC ${OpenMP_CXX_FLAGS})
target_compile_options(omni_slam_matching_eval_node PUBLIC ${OpenMP_CXX_FLAGS})
target_compile_options(omni_slam_reconstruction_eval_node PUBLIC ${OpenMP_CXX_FLAGS})
target_compile_options(omni_slam_odometry_eval_node PUBLIC ${OpenMP_CXX_FLAGS})
target_compile_options(omni_slam_stereo_eval_node PUBLIC ${OpenMP_CXX_FLAGS})
target_compile_options(omni_slam_slam_eval_node PUBLIC ${OpenMP_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -std=c++17")
install(TARGETS omni_slam_tracking_eval_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS omni_slam_matching_eval_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS omni_slam_reconstruction_eval_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS omni_slam_odometry_eval_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS omni_slam_stereo_eval_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS omni_slam_slam_eval_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)