forked from wavelab/mcptam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
231 lines (197 loc) · 6.24 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
cmake_minimum_required(VERSION 2.8.3)
project(mcptam)
# Add cmake_modules directory to cmake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
# Define build type
set(CMAKE_BUILD_TYPE None)
# Set our own specific flags. Want something like RelWithDebInfo but without the
# -DNDEBUG flag that disables asserts
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x -march=native -msse3 -O3 -g -fopenmp")
#Testing options, set to true if you want to build the rostests
SET(BUILD_TEST TRUE)
# Find various packages in order to set up environment variables
find_package(catkin REQUIRED COMPONENTS roscpp image_transport sensor_msgs cv_bridge geometry_msgs tf message_filters std_msgs
std_srvs visualization_msgs dynamic_reconfigure pcl_ros message_generation roslint)
find_package(Boost REQUIRED COMPONENTS system thread)
find_package(CVD REQUIRED)
find_package(OpenGL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(GLUT REQUIRED)
find_package(SUITESPARSE REQUIRED)
find_package(G2O REQUIRED)
find_package(GVars3 REQUIRED)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
message(STATUS "G2O_CORE_LIBRARY=${G2O_CORE_LIBRARY}")
include_directories(include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${SUITESPARSE_INCLUDE_DIRS}
${CVD_INCLUDE_DIR}
${GVars3_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
)
link_directories(${catkin_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
${SUITESPARSE_LIBRARY_DIRS}
${OpenCV_LIB_DIR}
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
)
add_message_files(
DIRECTORY msg
FILES MapInfo.msg
MapMakerTiming.msg
NetworkMapPoint.msg
NetworkMeasurement.msg
NetworkKeyFrame.msg
NetworkMultiKeyFrame.msg
NetworkOutlier.msg
SystemInfo.msg
TrackerTiming.msg
TrackerState.msg
)
add_service_files( DIRECTORY srv
FILES
ModifyMap.srv
Reset.srv
)
generate_messages(DEPENDENCIES std_msgs sensor_msgs)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} $
CATKIN_DEPENDS roscpp
image_transport
sensor_msgs
cv_bridge geometry_msgs
tf
message_filters
std_msgs
std_srvs
visualization_msgs
dynamic_reconfigure
pcl_ros
message_runtime
DEPENDS SuiteSparse
CVD
OpenGL
GVars3
)
# Check source for formatting
roslint_cpp()
# Tests
roslint_add_test()
set(MCPTAM_FUNCTIONS_LIB_SRC
src/BundleAdjusterBase.cpp
src/BundleAdjusterCalib.cpp
src/BundleAdjusterMulti.cpp
src/BundleAdjusterSingle.cpp
src/CalibCornerPatch.cpp
src/CalibGridCorner.cpp
src/CalibImageTaylor.cpp
src/CameraCalibrator.cpp
src/CameraGroupSubscriber.cpp
src/ChainBundle.cpp
src/EntropyComputation.cpp
src/GLWindow2.cpp
src/GLWindowMenu.cpp
src/KeyFrame.cpp
src/KeyFrameViewer.cpp
src/Map.cpp
src/MapMaker.cpp
src/MapMakerBase.cpp
src/MapMakerCalib.cpp
src/MapMakerClient.cpp
src/MapMakerClientBase.cpp
src/MapMakerServer.cpp
src/MapMakerServerBase.cpp
src/MapPoint.cpp
src/MiniPatch.cpp
src/NetworkManager.cpp
src/PatchFinder.cpp
src/PoseCalibrator.cpp
src/Relocaliser.cpp
src/ShiTomasi.cpp
src/SmallBlurryImage.cpp
src/System.cpp
src/SystemBase.cpp
src/SystemClient.cpp
src/SystemFrontendBase.cpp
src/SystemServer.cpp
src/TaylorCamera.cpp
src/Tracker.cpp
src/TrackerCalib.cpp
src/VideoSourceMulti.cpp
src/VideoSourceSingle.cpp
)
set(MCPTAM_SRC
src/Main.cpp
)
set(MCPTAM_CLIENT_SRC
src/MainClient.cpp
)
set(MCPTAM_SERVER_SRC
src/MainServer.cpp
)
set(POSE_CALIBRATOR_SRC
src/MainPoseCalibrator.cpp
)
set(CAMERA_CALIBRATOR_SRC
src/MainCameraCalibrator.cpp
)
set(MCPTAM_LIBS
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${SUITESPARSE_LIBRARIES}
${CVD_LIBRARY}
${OPENGL_gl_LIBRARY}
${OpenCV_LIBS}
${GVars3_LIBRARIES}
${G2O_STUFF_LIBRARY}
${G2O_CORE_LIBRARY}
${G2O_SOLVER_CHOLMOD}
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
)
# create a library of all the non-main functions
add_library(mcptam_functions ${MCPTAM_FUNCTIONS_LIB_SRC})
add_dependencies(mcptam_functions ${PROJECT_NAME}_gencpp)
target_link_libraries(mcptam_functions ${MCPTAM_LIBS})
# add executables and link them to the libraries
add_executable(mcptam ${MCPTAM_SRC} )
add_dependencies(mcptam ${PROJECT_NAME}_gencpp)
target_link_libraries(mcptam ${MCPTAM_LIBS} mcptam_functions)
add_executable(mcptam_client ${MCPTAM_CLIENT_SRC})
add_dependencies(mcptam_client ${PROJECT_NAME}_gencpp)
target_link_libraries(mcptam_client ${MCPTAM_LIBS} mcptam_functions)
add_executable(mcptam_server ${MCPTAM_SERVER_SRC})
add_dependencies(mcptam_server ${PROJECT_NAME}_gencpp)
target_link_libraries(mcptam_server ${MCPTAM_LIBS} mcptam_functions)
add_executable(camera_calibrator ${CAMERA_CALIBRATOR_SRC})
add_dependencies(camera_calibrator ${PROJECT_NAME}_gencpp)
target_link_libraries(camera_calibrator ${MCPTAM_LIBS} mcptam_functions)
add_executable(pose_calibrator ${POSE_CALIBRATOR_SRC})
add_dependencies(pose_calibrator ${PROJECT_NAME}_gencpp)
target_link_libraries(pose_calibrator ${MCPTAM_LIBS} mcptam_functions)
if(BUILD_TEST)
MESSAGE("testing entropy functions")
find_package(rostest REQUIRED)
add_rostest_gtest(test_entropy
test/entropy_test.test
test/entropy_test.cpp
)
target_link_libraries(test_entropy ${catkin_LIBRARIES})
endif()
install(TARGETS mcptam mcptam_client mcptam_server camera_calibrator pose_calibrator
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
PATTERN ".svn" EXCLUDE
)
install(DIRECTORY masks/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/masks
PATTERN ".svn" EXCLUDE
)