forked from izhengfan/se2clam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
158 lines (131 loc) · 3.07 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
cmake_minimum_required(VERSION 2.8.3)
project(se2clam)
add_subdirectory(Thirdparty/DBoW2)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules/)
# c++ 11 support for g2o, multi-thread and shared_ptr
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
find_package(Eigen REQUIRED)
find_package(OpenCV REQUIRED)
find_package(CSparse REQUIRED)
find_package(Cholmod REQUIRED)
find_package(G2O REQUIRED)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
nav_msgs
roscpp
rospy
tf
roslib
cv_bridge
cmake_modules
image_transport
message_generation
)
#add_message_files(
# FILES
# SyncOdoImg.msg
#)
#generate_messages(
# DEPENDENCIES
# std_msgs
# sensor_msgs
# geometry_msgs
#)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES se2clam
# CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy tf
# DEPENDS Eigen OpenCV Boost
# CATKIN_DEPENDS message_runtime
)
include_directories(
${catkin_INCLUDE_DIRS}
)
list(APPEND LINK_LIBS
${catkin_LIBRARIES}
)
# if do not use ros
#find_package(Pangolin REQUIRED)
#include_directories(
# ${Pangolin_INCLUDE_DIRS}
#)
#list(APPEND LINK_LIBS
# ${Pangolin_LIBRARIES}
#)
include_directories(
include/se2clam/
${CMAKE_CURRENT_SOURCE_DIR}
${EIGEN_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${CSPARSE_INCLUDE_DIR}
${Cholmod_INCLUDE_DIR}
${G2O_INCLUDE_DIR}
)
list(APPEND LINK_LIBS
${OpenCV_LIBS}
)
list(APPEND G2O_LIBS
cxsparse
cholmod
g2o_solver_slam2d_linear g2o_types_icp g2o_types_slam2d
g2o_core g2o_solver_csparse g2o_solver_structure_only
g2o_types_sba g2o_types_slam3d g2o_csparse_extension
g2o_solver_dense g2o_stuff
g2o_types_sclam2d g2o_solver_pcg
g2o_types_data g2o_types_sim3
)
## Build a lib
FILE(GLOB_RECURSE IncFiles "include/se2clam/*.h")
aux_source_directory(src/. DIR_SRCS)
add_library(se2clam ${DIR_SRCS} ${IncFiles})
## Specify libraries to link a library or executable target against
target_link_libraries(se2clam
${LINK_LIBS}
${G2O_LIBS}
DBoW2se2clam
)
## Build an exe
add_executable(test_vn test/test_vn.cpp)
## Specify libraries to link a library or executable target against
target_link_libraries(test_vn
se2clam
${LINK_LIBS}
${G2O_LIBS}
#${CMAKE_CURRENT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
)
add_executable(datapub test/datapub.cpp)
target_link_libraries(datapub
se2clam
${LINK_LIBS}
)
add_executable(imgview test/imgview.cpp)
target_link_libraries(imgview
se2clam
${LINK_LIBS}
)
#add_executable(simpletest test/simpletest.cpp)
#target_link_libraries(simpletest
#se2clam
#${LINK_LIBS}
#)
## Build a publisher for vn dataset
#add_executable(publish_vn test/publish_vn.cpp)
#target_link_libraries(publish_vn
#${LINK_LIBS}
#se2clam
#)
## Build a subscriber for vn dataset
#add_executable(subscribe_vn test/subscribe_vn.cpp)
#target_link_libraries(subscribe_vn
#${LINK_LIBS}
#se2clam
#)
# Build a subscriber test for vn dataset
add_executable(test_ros test/test_ros.cpp)
target_link_libraries(test_ros
se2clam
${LINK_LIBS}
)