forked from KumarRobotics/msckf_vio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
175 lines (153 loc) · 3.57 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
cmake_minimum_required(VERSION 2.8.12)
project(msckf_vio)
add_compile_options(-std=c++11)
# Modify cmake module path if new .cmake files are required
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
tf
nav_msgs
sensor_msgs
geometry_msgs
eigen_conversions
tf_conversions
random_numbers
message_generation
nodelet
image_transport
cv_bridge
message_filters
pcl_conversions
pcl_ros
std_srvs
)
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED)
find_package(Eigen3 REQUIRED)
# set(OpenCV_DIR /opt/opencv3/share/OpenCV)
find_package(OpenCV REQUIRED)
find_package(SuiteSparse REQUIRED)
##################
## ROS messages ##
##################
add_message_files(
FILES
FeatureMeasurement.msg
CameraMeasurement.msg
TrackingInfo.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES msckf_vio image_processor
CATKIN_DEPENDS
roscpp std_msgs tf nav_msgs sensor_msgs geometry_msgs
eigen_conversions tf_conversions random_numbers message_runtime
image_transport cv_bridge message_filters pcl_conversions
pcl_ros std_srvs
DEPENDS Boost EIGEN3 OpenCV SUITESPARSE
)
###########
## Build ##
###########
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${SUITESPARSE_INCLUDE_DIRS}
)
# Msckf Vio
add_library(msckf_vio
src/msckf_vio.cpp
src/utils.cpp
)
add_dependencies(msckf_vio
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(msckf_vio
${catkin_LIBRARIES}
${SUITESPARSE_LIBRARIES}
)
# Msckf Vio nodelet
add_library(msckf_vio_nodelet
src/msckf_vio_nodelet.cpp
)
add_dependencies(msckf_vio_nodelet
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(msckf_vio_nodelet
msckf_vio
${catkin_LIBRARIES}
)
# Image processor
add_library(image_processor
src/image_processor.cpp
src/utils.cpp
)
add_dependencies(image_processor
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(image_processor
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
# Image processor nodelet
add_library(image_processor_nodelet
src/image_processor_nodelet.cpp
)
add_dependencies(image_processor_nodelet
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(image_processor_nodelet
image_processor
${catkin_LIBRARIES}
)
#############
## Install ##
#############
install(TARGETS
msckf_vio msckf_vio_nodelet image_processor image_processor_nodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN "*_nodelet.h" EXCLUDE
)
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
#############
## Testing ##
#############
if(CATKIN_ENABLE_TESTING)
# Feature initialization test
catkin_add_gtest(test_feature_init
test/feature_initialization_test.cpp
)
add_dependencies(test_feature_init
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(test_feature_init
${catkin_LIBRARIES}
)
# Math utils test
catkin_add_gtest(test_math_utils
test/math_utils_test.cpp
)
endif()