forked from ctu-mrs/uvdar_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
254 lines (206 loc) · 7.67 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
cmake_minimum_required(VERSION 3.1.2)
project(uvdar_core)
FILE(GLOB_RECURSE HEADER_FILES include *.h)
FILE(GLOB_RECURSE LAUNCHER_FILES include *.launch)
FILE(GLOB_RECURSE YAML_FILES include *.yaml)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -g -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++17 -g -Wall -Wextra -O3")
# set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 -g -DNDEBUG -std=c++17 -g -Wall -Wextra")
find_package(catkin REQUIRED COMPONENTS
roscpp
nodelet
cv_bridge
image_transport
sensor_msgs
std_msgs
mrs_msgs
mrs_modules_msgs
mrs_lib
tf2
tf2_ros
tf2_msgs
tf2_eigen
tf2_sensor_msgs
tf_conversions
tf2_eigen
tf2_geometry_msgs
message_generation
message_runtime
# uvdar_gazebo_plugin
)
find_package(Eigen3 REQUIRED)
set(Eigen_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
set(Eigen_LIBRARIES ${Eigen_LIBRARIES})
find_package(OpenCV REQUIRED HINTS /usr/local/lib)
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL REQUIRED)
# find_package(LIBGBM REQUIRED)
# # pkg_check_modules(PC_LIBGBM gbm)
# find_path(LIBGBM_INCLUDE_DIRS
# NAMES gbm.h
# HINTS ${PC_LIBGBM_INCLUDE_DIRS} ${PC_LIBGBM_INCUDEDIR}
# )
find_library(LGBM libgbm.so REQUIRED)
find_library(LEGL libEGL.so REQUIRED)
find_library(LGL libGL.so REQUIRED)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGBM DEFAULT_MSG LIBGBM_LIBRARIES)
mark_as_advanced(LIBGBM_INCLUDE_DIRS LIBGBM_LIBRARIES)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
add_service_files(
FILES
# SetLedState.srv
SetLedMessage.srv
# SetIntIndex.srv
SetInts.srv
)
add_message_files(DIRECTORY msg FILES
FrequencySet.msg
USM.msg
RecMsg.msg
DefaultMsg.msg
omtaDataForLogging.msg
omtaSeqVariables.msg
omtaAllSequences.msg
omtaSeqPoint.msg
ImagePointsWithFloatStamped.msg
Point2DWithFloat.msg
Int32MultiArrayStamped.msg
)
generate_messages(DEPENDENCIES
mrs_msgs
# uvdar_gazebo_plugin
std_msgs
sensor_msgs
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS cv_bridge image_transport roscpp sensor_msgs std_msgs message_runtime mrs_msgs mrs_modules_msgs message_generation
DEPENDS Eigen
LIBRARIES OCamCalib unscented
)
###########
## Build ##
###########
include_directories(
include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${OpenGL_INCLUDE_DIRS}
${LIBGBM_INCLUDE_DIRS}
)
add_executable(uvdar_rx_node src/uvdar_rx.cpp)
add_executable(uvdar_tx_node src/uvdar_tx.cpp)
# add_executable(new_uvdar_rx_node src/new_uvdar_rx.cpp)
add_library(OCamCalib include/OCamCalib/ocam_functions.cpp )
target_compile_options(OCamCalib PRIVATE -Wno-unused-variable -Wno-unused-result)
add_library(ht4dbt include/ht4dbt/ht4d.cpp include/ht4dbt/ht4d_cpu.cpp include/ht4dbt/ht4d_gpu.cpp)
add_library(omta include/omta/omta.cpp)
add_library(extendedSearch include/omta/extended_search.cpp)
add_library(uv_led_detect_fast include/detect/uv_led_detect_fast_cpu.cpp include/detect/uv_led_detect_fast_gpu.cpp)
add_library(frequency_classifier include/frequency_classifier/frequency_classifier.cpp)
add_library(color_selector include/color_selector/color_selector.cpp)
# add_library(SignalSetter src/signal_setter.cpp)
add_library(compute_lib include/compute_lib/compute_lib.c include/compute_lib/queue.c include/compute_lib/gl32_utils.c)
target_link_libraries(compute_lib
debug ${OpenGL_LIBRARIES} ${LIBGBM_LIBRARIES} ${catkin_LIBRARIES} ${LGBM} ${LEGL} ${LGL})
target_link_libraries(uvdar_rx_node ${catkin_LIBRARIES})
target_link_libraries(uvdar_tx_node ${catkin_LIBRARIES})
# target_link_libraries(new_uvdar_rx_node ${catkin_LIBRARIES} ${OpenCV_LIBRARIES} ht4dbt)
# target_link_libraries(SignalSetter ${catkin_LIBRARIES})
# add_dependencies(new_uvdar_rx_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(uvdar_rx_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(uvdar_tx_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(ht4dbt compute_lib)
target_link_libraries(uv_led_detect_fast
debug ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} compute_lib)
target_link_libraries(frequency_classifier
debug ${OpenCV_LIBRARIES} ${catkin_LIBRARIES})
target_link_libraries(color_selector
debug ${OpenCV_LIBRARIES} ${catkin_LIBRARIES})
add_library(UVDARDetector src/detector.cpp)
add_dependencies(UVDARDetector ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(unscented include/unscented/unscented.cpp)
add_dependencies(unscented ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(p3p include/p3p/P3p.cpp)
add_dependencies(p3p ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(UVDARBlinkProcessor src/blink_processor.cpp)
add_dependencies(UVDARBlinkProcessor ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
# add_library(ROSTOPIC_HZ src/nodelet_rostopic_hz.cpp)
# add_dependencies(ROSTOPIC_HZ ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
# add_executable(uvdar_uav_pose_calculator_node src/uav_pose_calculator.cpp)
# add_dependencies(uvdar_uav_pose_calculator_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(uvdar_pose_calculator_node src/pose_calculator.cpp)
add_dependencies(uvdar_pose_calculator_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(uvdar_filter_node src/filter.cpp)
add_dependencies(uvdar_filter_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(UVDARBluefoxEmulator src/bluefox_emulator.cpp)
add_dependencies(UVDARBluefoxEmulator ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
# add_executable(uvdar_frequency_setter_node src/frequency_setter.cpp)
# add_dependencies(uvdar_frequency_setter_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(uvdar_led_manager_node src/led_manager.cpp)
add_dependencies(uvdar_led_manager_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_custom_target(headers SOURCES ${HEADER_FILES} ${LAUNCHER_FILES} ${YAML_FILES})
target_link_libraries(UVDARDetector
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
uv_led_detect_fast
compute_lib
)
target_link_libraries(UVDARBlinkProcessor
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
ht4dbt
frequency_classifier
omta
extendedSearch
color_selector
)
# target_link_libraries(uvdar_uav_pose_calculator_node
# ${catkin_LIBRARIES}
# ${OpenCV_LIBRARIES}
# ${EIGEN3_LIBRARIES}
# OCamCalib
# unscented
# p3p
# color_selector
# frequency_classifier
# )
target_link_libraries(uvdar_pose_calculator_node
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
OCamCalib
unscented
p3p
color_selector
frequency_classifier
)
target_link_libraries(uvdar_filter_node
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
)
target_link_libraries(UVDARBluefoxEmulator
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
OCamCalib
)
# target_link_libraries(uvdar_frequency_setter_node
# ${catkin_LIBRARIES}
# )
target_link_libraries(uvdar_led_manager_node
${catkin_LIBRARIES}
)