-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·163 lines (140 loc) · 4.39 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
cmake_minimum_required(VERSION 2.8)
project(vslam)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -O3 -march=native -pthread")
#------------------------------------------
# G2O
#------------------------------------------
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
find_package( G2O REQUIRED )
include_directories(${G2O_INCLUDE_DIR})
find_package( Cholmod )
include_directories(${CHOLMOD_INCLUDE_DIR})
find_package(CSparse)
include_directories(${CSPARSE_INCLUDE_DIR})
list(APPEND G2O_LIBS
g2o_cli g2o_ext_freeglut_minimal g2o_simulator
g2o_solver_slam2d_linear g2o_types_icp g2o_types_slam2d
g2o_core g2o_interface g2o_solver_csparse g2o_solver_structure_only
g2o_types_sba g2o_types_slam3d g2o_csparse_extension
g2o_opengl_helper g2o_solver_dense g2o_stuff
g2o_types_sclam2d g2o_parser g2o_solver_pcg
g2o_types_data g2o_types_sim3
)
#------------------------------------------
# OpenCV
#------------------------------------------
find_package( OpenCV REQUIRED )
include_directories(${OPENCV_INCLUDE_DIRS})
#------------------------------------------
# Eigen
#------------------------------------------
find_package(Eigen3 3.0 REQUIRED NO_MODULE)
include_directories(${EIGEN3_INCLUDE_DIR})
#------------------------------------------
# DBoW3
#------------------------------------------
find_package( DBoW3 REQUIRED )
include_directories( ${DBoW3_INCLUDE_DIRS} )
#------------------------------------------
# Pangolin
#------------------------------------------
find_package(Pangolin REQUIRED)
include_directories(${Pangolin_INCLUDE_DIRS})
#------------------------------------------
# PCL
#------------------------------------------
find_package(PCL REQUIRED COMPONENTS common registration visualization)
add_definitions(${PCL_DEFINITIONS})
include_directories(${PCL_INCLUDE_DIRS})
link_libraries(${PCL_LIBRARY_DIRS})
#------------------------------------------
# OpenGL
#------------------------------------------
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS})
#------------------------------------------
# Octomap
#------------------------------------------
find_package(octomap)
include_directories(${OCTOMAP_INCLUDE_DIRS})
#------------------------------------------
# fast
#------------------------------------------
FIND_PACKAGE(fast REQUIRED)
include_directories(${fast_INCLUDE_DIRS})
#------------------------------------------
# opengv
#------------------------------------------
find_package(opengv REQUIRED)
#------------------------------------------
# Qt
#------------------------------------------
#set(CMAKE_AUTOMOC ON)
#set(CMAKE_AUTOUIC ON)
#find_package(Qt5Widgets)
#find_package(Qt5Core)
include_directories(${PROJECT_SOURCE_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
add_library(${PROJECT_NAME} SHARED
System/Tracking.cpp
System/Converter.cpp
System/Utility.cpp
System/Random.cpp
Features/Extractor.cpp
Features/ORBextractor.cpp
Features/Matcher.cpp
Features/ExtractorNode.cpp
Features/SVOextractor.cpp
Features/DetectorAdjuster.cpp
Features/StatefulFeatureDetector.cpp
Features/VideoDynamicAdaptedFeatureDetector.cpp
Features/VideoGridAdaptedFeatureDetector.cpp
Core/RGBDcamera.cpp
Core/IntrinsicMatrix.cpp
Core/Frame.cpp
Core/Map.cpp
Core/Landmark.cpp
Core/GraphNode.cpp
Solver/SolverSE3.cpp
Solver/Icp.cpp
Solver/PoseGraph.cpp
Solver/PnPRansac.cpp
Solver/Solver.cpp
Solver/PnPSolver.cpp
Solver/Ransac.cpp
Solver/Gicp.cpp
Solver/PnP.cpp
PlaceRecognition/LoopDetector.cpp
Drawer/Viewer.cpp
Drawer/MapDrawer.cpp
Drawer/OctomapDrawer.cpp
IO/Dataset.cpp
IO/DatasetTUM.cpp
IO/DatasetICL.cpp
IO/DatasetCORBS.cpp
)
target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${PCL_LIBRARIES}
${Pangolin_LIBRARIES}
${DBoW3_LIBS}
${BOOST_LIBRARIES}
${OPENGL_LIBRARIES}
${GLUT_LIBRARY}
${G2O_LIBS}
${CHOLMOD_LIBRARIES}
${CSPARSE_LIBRARY}
${OCTOMAP_LIBRARIES}
${fast_LIBRARIES}
opengv
#Qt5::Widgets
#Qt5::Core
)
add_executable(main main.cpp)
target_link_libraries(main
${PROJECT_NAME}
)