-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
161 lines (131 loc) · 3.79 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
cmake_minimum_required(VERSION 3.5)
project(bb_utils)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(OpenCV REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(derived_object_msgs REQUIRED)
find_package(vision_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2_msgs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(rosgraph_msgs REQUIRED)
find_package(bb_interfaces REQUIRED)
find_package(message_filters REQUIRED)
find_package(rosbag2_cpp REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(image_geometry REQUIRED)
# Add to run launch files
install(DIRECTORY
config
launch
DESTINATION share/${PROJECT_NAME}
)
# Add to include header files
include_directories(include)
# %%%%%%%%%%%%%%%%%%%%%%% TO USE IMGUI
find_package(Vulkan REQUIRED)
# GLFW
set(GLFW_DIR /opt/opengl/glfw-3.3.8) # -----> Set this to point to an up-to-date GLFW repo
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
option(GLFW_INSTALL "Generate installation target" OFF)
option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL)
include_directories(${GLFW_DIR}/include)
# Dear ImGui
set(IMGUI_DIR /opt/imgui/) # -------> Set this to point to an up-to-date Dear ImGui repo
# ImPlot
set(IMPLOT_DIR /opt/implot/) # -------> Set this to point to an up-to-date ImPlot repo
include_directories(${IMGUI_DIR} ${IMPLOT_DIR} ${IMGUI_DIR}/backends ..)
file(GLOB imgui_files
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
)
file(GLOB implot_files
${IMPLOT_DIR}/implot.cpp
${IMPLOT_DIR}/implot_items.cpp
${IMPLOT_DIR}/implot_demo.cpp
)
# ImGui_f
include_directories(/opt/ImGui-f/src) # -------> Set this to point to an up-to-date ImGui-f repo
# Libraries
set(LIBRARIES "glfw;Vulkan::Vulkan")
# Use vulkan headers from glfw:
include_directories(${GLFW_DIR}/deps)
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# EXECUTABLES
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%% VISUALIZER %%%%%%%%%%%
add_executable(bb_visualizer
src/bb_visualizer.cpp
${imgui_files} # added imgui files
${implot_files} # added implot files
)
ament_target_dependencies(bb_visualizer
rclcpp
std_msgs
geometry_msgs
visualization_msgs
tf2_geometry_msgs
bb_interfaces
)
# Added for ImGui
target_link_libraries(bb_visualizer
${LIBRARIES}
)
# %%%%%%%%% BAG CONVERTER %%%%%%%%%
add_executable(rewrite_bag_timestamps src/rewrite_bag_timestamps.cpp)
ament_target_dependencies(rewrite_bag_timestamps
rosbag2_cpp
rclcpp
sensor_msgs
vision_msgs
rosgraph_msgs
tf2_msgs
derived_object_msgs
visualization_msgs
)
# ------------------
# %%%%%%%%% BB_BENCHMARK %%%%%%%%%%%
add_executable(bb_benchmark
src/bb_benchmark.cpp
src/lapjv.cpp
)
ament_target_dependencies(bb_benchmark
rclcpp
tf2_ros
tf2_geometry_msgs
vision_msgs
visualization_msgs
OpenCV
image_geometry
bb_interfaces
)
# -----------
install(TARGETS
bb_visualizer
rewrite_bag_timestamps
bb_benchmark
DESTINATION lib/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()