forked from koide3/interactive_slam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
162 lines (141 loc) · 4 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
cmake_minimum_required(VERSION 2.8.3)
project(interactive_slam)
set (IS_VERSION_MAJOR 1)
set (IS_VERSION_MINOR 0)
set (IS_VERSION_REVISION 5)
execute_process (COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE GIT_LAST_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND git log -1 --format=%cd WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE GIT_LAST_COMMIT_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
set (LAST_COMMIT_HASH \"${GIT_LAST_COMMIT_HASH}\")
set (LAST_COMMIT_DATE \"${GIT_LAST_COMMIT_DATE}\")
configure_file (
"${PROJECT_SOURCE_DIR}/include/hdl_graph_slam/version.h.in"
"${PROJECT_SOURCE_DIR}/include/hdl_graph_slam/version.h"
)
if("$ENV{ROS_DISTRO}" STRGREATER "melodic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(catkin REQUIRED COMPONENTS roscpp ndt_omp hdl_graph_slam roslib)
find_package(GLM REQUIRED)
find_package(OpenGL REQUIRED)
find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED filesystem program_options)
find_package(G2O REQUIRED)
include_directories(SYSTEM ${G2O_INCLUDE_DIR} ${G2O_INCLUDE_DIRS})
link_directories(${G2O_LIBRARY_DIRS})
##################
# catking config #
##################
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES interactive_map_correction
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
)
###########
## Build ##
###########
include_directories(
include
thirdparty/gl3w
thirdparty/imgui
thirdparty/imgui/examples
thirdparty/portable-file-dialogs
${GLM_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
# imgui
add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GL3W)
###########
## Build ##
###########
add_library(imgui STATIC
thirdparty/gl3w/gl3w.c
thirdparty/imgui/imgui.cpp
thirdparty/imgui/imgui_demo.cpp
thirdparty/imgui/imgui_draw.cpp
thirdparty/imgui/imgui_widgets.cpp
thirdparty/imgui/examples/imgui_impl_glfw.cpp
thirdparty/imgui/examples/imgui_impl_opengl3.cpp
)
target_link_libraries(imgui
${OPENGL_LIBRARIES}
glfw
dl
)
add_library(guik STATIC
src/glk/mesh.cpp
src/glk/lines.cpp
src/glk/colormap.cpp
src/glk/glsl_shader.cpp
src/glk/frame_buffer.cpp
src/glk/pointcloud_buffer.cpp
src/glk/primitives/primitives.cpp
src/glk/loaders/ply_loader.cpp
src/guik/gl_canvas.cpp
src/guik/model_control.cpp
src/guik/camera_control.cpp
src/guik/projection_control.cpp
src/guik/imgui_application.cpp
)
add_executable(odometry2graph
src/odometry2graph.cpp
src/hdl_graph_slam/version_modal.cpp
)
target_link_libraries(odometry2graph
${PCL_LIBRARIES}
${G2O_TYPES_DATA}
${G2O_CORE_LIBRARY}
${G2O_TYPES_SLAM3D}
${OPENGL_LIBRARIES}
${catkin_LIBRARIES}
glfw
guik
imgui
)
add_executable(interactive_slam
src/interactive_slam.cpp
src/hdl_graph_slam/registration_methods.cpp
src/hdl_graph_slam/interactive_graph.cpp
src/hdl_graph_slam/interactive_keyframe.cpp
src/hdl_graph_slam/version_modal.cpp
src/hdl_graph_slam/graph_edit_window.cpp
src/hdl_graph_slam/edge_refinement_window.cpp
src/hdl_graph_slam/plane_detection_window.cpp
src/hdl_graph_slam/plane_alignment_modal.cpp
src/hdl_graph_slam/manual_loop_close_modal.cpp
src/hdl_graph_slam/automatic_loop_close_window.cpp
src/hdl_graph_slam/view/edge_view.cpp
src/hdl_graph_slam/view/vertex_view.cpp
)
target_link_libraries(interactive_slam
${PCL_LIBRARIES}
${G2O_TYPES_DATA}
${G2O_CORE_LIBRARY}
${G2O_STUFF_LIBRARY}
${G2O_SOLVER_PCG}
${G2O_SOLVER_CSPARSE}
${G2O_SOLVER_CHOLMOD}
${G2O_TYPES_SLAM3D}
${G2O_TYPES_SLAM3D_ADDONS}
${OPENGL_LIBRARIES}
${catkin_LIBRARIES}
glfw
guik
imgui
)
file(COPY data DESTINATION .)
install(TARGETS
interactive_slam
odometry2graph
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY data
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)