-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
272 lines (213 loc) · 7.84 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
cmake_minimum_required(VERSION 3.8)
project(flexmap_fusion)
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-local-typedefs)
endif()
add_definitions("-DBOOST_ALLOW_DEPRECATED_HEADERS")
add_definitions("-DBOOST_BIND_GLOBAL_PLACEHOLDERS")
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(CURL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(lanelet2_core REQUIRED)
find_package(lanelet2_io REQUIRED)
find_package(lanelet2_projection REQUIRED)
find_package(PCL REQUIRED)
file(MAKE_DIRECTORY lib)
include_directories(SYSTEM
${PCL_INCLUDE_DIRS}
)
####################################
# file_in
####################################
add_library(file_in SHARED
src/file_io/file_in.cpp
)
target_include_directories(file_in
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/file_io>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(file_in rclcpp CURL lanelet2_core lanelet2_io lanelet2_projection)
target_link_libraries(file_in ${PCL_LIBRARIES})
####################################
# file_out
####################################
add_library(file_out SHARED
src/file_io/file_out.cpp
)
target_include_directories(file_out
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/file_io>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(file_out rclcpp lanelet2_core lanelet2_io lanelet2_projection)
target_link_libraries(file_out ${PCL_LIBRARIES})
####################################
# extract_network
####################################
add_library(extract_network SHARED
src/extract_network/extract_network.cpp
)
target_include_directories(extract_network
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/extract_network>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(extract_network rclcpp lanelet2_core lanelet2_io lanelet2_projection)
####################################
# map_transformation
####################################
# Transformation with Umeyama/ICP
add_library(align SHARED
src/map_transformation/align.cpp
)
target_include_directories(align
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/map_transformation>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(align rclcpp Eigen3 lanelet2_core lanelet2_io lanelet2_projection)
# Rubber-Sheeting
add_library(rubber_sheeting SHARED
src/map_transformation/rubber_sheeting.cpp
)
target_include_directories(rubber_sheeting
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/map_transformation>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(rubber_sheeting rclcpp geometry_msgs Eigen3 lanelet2_core lanelet2_io lanelet2_projection)
target_link_libraries(rubber_sheeting ${PCL_LIBRARIES})
####################################
# conflation
####################################
# Map matching
add_library(matching SHARED
src/conflation/matching.cpp
)
target_include_directories(matching
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/conflation>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(matching rclcpp Eigen3 lanelet2_core lanelet2_io lanelet2_projection)
# Map conflation
add_library(conflation SHARED
src/conflation/conflation.cpp
)
target_include_directories(conflation
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/conflation>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(conflation rclcpp Eigen3 lanelet2_core lanelet2_io lanelet2_projection)
####################################
# messages
####################################
# message conversion
add_library(message_conversion SHARED
src/messages/message_conversion.cpp
)
target_include_directories(message_conversion
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/messages>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(message_conversion rclcpp geometry_msgs visualization_msgs lanelet2_core lanelet2_io lanelet2_projection)
add_library(visualization SHARED
src/messages/visualization.cpp
)
# visualization
target_include_directories(visualization
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/messages>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(visualization rclcpp geometry_msgs visualization_msgs lanelet2_core lanelet2_io lanelet2_projection)
add_library(messages SHARED
src/messages/messages.cpp
)
# messages
target_include_directories(messages
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/messages>
$<INSTALL_INTERFACE:include>)
target_link_libraries(messages message_conversion visualization ${PCL_LIBRARIES})
ament_target_dependencies(messages rclcpp geometry_msgs visualization_msgs pcl_conversions lanelet2_core lanelet2_io lanelet2_projection)
####################################
# analysis
####################################
add_library(analysis SHARED
src/analysis/analysis.cpp
)
target_include_directories(analysis
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion/analysis>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(analysis rclcpp Eigen3 lanelet2_core lanelet2_io lanelet2_projection)
####################################
# Main Executables
####################################
# lanelet2_osm_fusion
add_executable(lanelet2_osm
src/lanelet2_osm.cpp
)
target_include_directories(lanelet2_osm
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(lanelet2_osm rclcpp geometry_msgs visualization_msgs lanelet2_core lanelet2_io lanelet2_projection)
target_link_libraries(lanelet2_osm file_in file_out extract_network align rubber_sheeting
matching conflation messages analysis)
# kiss_icp_georef
add_executable(kiss_icp_georef
src/kiss_icp_georef.cpp
)
target_include_directories(kiss_icp_georef
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flexmap_fusion>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(kiss_icp_georef rclcpp geometry_msgs visualization_msgs lanelet2_core lanelet2_io lanelet2_projection)
target_link_libraries(kiss_icp_georef file_in file_out align rubber_sheeting messages analysis)
####################################
# Building
####################################
install(
DIRECTORY lib/
DESTINATION lib
)
install(TARGETS
file_in
file_out
extract_network
align
rubber_sheeting
matching
conflation
message_conversion
visualization
messages
analysis
DESTINATION lib
)
install(TARGETS
lanelet2_osm
kiss_icp_georef
DESTINATION lib/${PROJECT_NAME})
install(DIRECTORY
config
launch
DESTINATION share/${PROJECT_NAME})
ament_package()