-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
292 lines (238 loc) · 9.42 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# I have followed the tutorial from here:
# https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
cmake_minimum_required(VERSION 3.5)
project(
idbastar
VERSION 0.1.0
LANGUAGES CXX)
# find_package(pinocchio REQUIRED)
find_package(Boost REQUIRED COMPONENTS program_options serialization
stacktrace_basic)
find_package(ompl REQUIRED)
include(FindThreads)
message(STATUS "OMPL_FOUND: ${OMPL_FOUND}")
message(STATUS "OMPL_INCLUDE_DIRS: ${OMPL_INCLUDE_DIRS}")
message(STATUS "OMPL_LIBRARIES: ${OMPL_LIBRARIES}")
message(STATUS "OMPL_VERSION: ${OMPL_VERSION}")
find_package(fcl REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(crocoddyl REQUIRED)
message(STATUS "CROCO_VERSION: ${CROCODDYL_VERSION}")
find_package(Eigen3 REQUIRED)
message(STATUS "FCL_INCLUDE_DIRS: ${FCL_INCLUDE_DIRS}")
message(STATUS "FCL_LIBRARIES: ${FCL_LIBRARIES}")
message(STATUS "FCL_VERSION: ${FCL_VERSION}")
# TODO: check why this is necessary
message(STATUS "Finding LZ4 libraries...")
find_library(
LZ4_LIBRARIES
NAMES liblz4.so
HINTS "lz4/lib")
if(LZ4_LIBRARIES)
message(STATUS "Found: ${LZ4_LIBRARIES}")
else()
message(STATUS "Not found: ${LZ4_LIBRARIES}")
message(FATAL_ERROR "Cannot find required LZ4 libraries")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(DISABLE_DYNOBENCH_TESTS ON)
add_subdirectory(dynobench)
add_executable(main_rrt_to ./src/ompl/main_rrt_to.cpp)
add_executable(main_primitives ./src/motion_primitives/main_primitives.cpp)
add_executable(from_boost_to_msgpack
./src/motion_primitives/from_boost_to_msgpack.cpp)
add_executable(main_sst ./src/ompl/main_sst.cpp)
add_executable(main_optimization ./src/optimization/main_optimization.cpp)
add_executable(main_multirobot_optimization
./src/optimization/main_multirobot_optimization.cpp)
add_executable(main_dbastar ./src/dbastar/main_dbastar.cpp)
add_executable(main_tdbastar ./src/tdbastar/main_tdbastar.cpp)
add_executable(main_idbastar ./src/idbastar/main_idbastar.cpp)
add_executable(main_dbrrt ./src/dbrrt/main_dbrrt.cpp)
# target_compile_options(main PRIVATE -Wall -Wextra)
add_library(motion_primitives ./src/motion_primitives/motion_primitives.cpp)
add_library(
optimization
./src/optimization/ocp.cpp ./src/optimization/options.cpp
./src/optimization/croco_models.cpp ./src/optimization/generate_ocp.cpp
./src/optimization/multirobot_optimization.cpp)
add_library(sst ./src/ompl/sst.cpp ./src/ompl/robots.cpp)
add_library(rrt_to ./src/ompl/rrt_to.cpp ./src/ompl/robots.cpp)
add_library(dbastar ./src/dbastar/dbastar.cpp ./src/dbastar/options.cpp
./src/ompl/robots.cpp ./src/dbastar/heuristics.cpp)
add_library(tdbastar ./src/tdbastar/tdbastar.cpp ./src/ompl/robots.cpp
./src/tdbastar/options.cpp ./src/dbastar/heuristics.cpp)
add_library(dbrrt ./src/dbrrt/dbrrt.cpp ./src/ompl/robots.cpp)
add_library(idbastar ./src/idbastar/idbastar.cpp)
add_library(idbastar::motion_primitives ALIAS motion_primitives) # for use in
# test folder
add_library(idbastar::optimization ALIAS optimization) # for use in test folder
add_library(idbastar::dbastar ALIAS dbastar) # for use in test folder
add_library(idbastar::dbrrt ALIAS dbrrt) # for use in test folder
add_library(idbastar::rrt_to ALIAS rrt_to) # for use in test folder
add_library(idbastar::idbastar ALIAS idbastar) # for use in test folder
add_library(idbastar::sst ALIAS sst) # for use in test folder
target_include_directories(
optimization
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${CROCODDYL_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_include_directories(
main_optimization
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_include_directories(
main_multirobot_optimization
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_include_directories(
sst
PUBLIC $<INSTALL_INTERFACE:include> ${OMPL_INCLUDE_DIRS}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src)
target_include_directories(
rrt_to
PUBLIC $<INSTALL_INTERFACE:include> ${OMPL_INCLUDE_DIRS}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src)
target_include_directories(
motion_primitives
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${OMPL_INCLUDE_DIRS} ${CROCODDYL_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src)
target_include_directories(
dbastar
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${OMPL_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src)
target_include_directories(
dbrrt
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${OMPL_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src)
# target_include_directories(main_dbastar PUBLIC $<INSTALL_INTERFACE:include>
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src )
#
target_link_libraries(
idbastar
PUBLIC dbastar optimization Eigen3::Eigen dynobench::dynobench
PRIVATE fcl ${OMPL_LIBRARIES} ${LZ4_LIBRARIES})
target_link_libraries(
sst
PUBLIC optimization Eigen3::Eigen dynobench::dynobench ${OMPL_LIBRARIES}
PRIVATE fcl ${LZ4_LIBRARIES})
target_link_libraries(
rrt_to
PUBLIC optimization Eigen3::Eigen dynobench::dynobench
PRIVATE fcl ${OMPL_LIBRARIES} ${LZ4_LIBRARIES})
target_link_libraries(
dbastar
PUBLIC Eigen3::Eigen dynobench::dynobench
PRIVATE fcl ${OMPL_LIBRARIES} ${LZ4_LIBRARIES})
target_link_libraries(
dbrrt
PUBLIC optimization Eigen3::Eigen dynobench::dynobench dbastar
PRIVATE fcl ${OMPL_LIBRARIES})
target_link_libraries(
main_dbastar
PUBLIC Eigen3::Eigen dbastar
PRIVATE fcl dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
Boost::serialization ${LZ4_LIBRARIES})
target_link_libraries(
main_idbastar
PUBLIC Eigen3::Eigen idbastar
PRIVATE fcl dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
Boost::serialization ${LZ4_LIBRARIES})
target_link_libraries(
main_dbrrt
PUBLIC dbrrt dbastar Eigen3::Eigen
PRIVATE fcl dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
Boost::serialization ${LZ4_LIBRARIES})
target_link_libraries(
main_sst
PUBLIC sst Eigen3::Eigen
PRIVATE fcl dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
Boost::serialization ${LZ4_LIBRARIES})
target_link_libraries(
main_rrt_to
PUBLIC rrt_to Eigen3::Eigen
PRIVATE fcl dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
Boost::serialization ${LZ4_LIBRARIES})
target_link_libraries(
motion_primitives
PUBLIC Eigen3::Eigen dynobench::dynobench
PRIVATE optimization
${CROCODDYL_LIBRARIES}
fcl
yaml-cpp
Boost::program_options
Boost::serialization
Threads::Threads)
target_link_libraries(
main_primitives PRIVATE motion_primitives optimization dynobench::dynobench
Boost::program_options Boost::serialization)
target_link_libraries(
from_boost_to_msgpack
PRIVATE motion_primitives optimization dynobench::dynobench
Boost::program_options Boost::serialization)
target_link_libraries(
optimization
PUBLIC Eigen3::Eigen dynobench::dynobench
PRIVATE ${CROCODDYL_LIBRARIES} fcl yaml-cpp Boost::program_options
Boost::serialization libipopt.so)
target_link_libraries(
main_optimization
PRIVATE ${CROCODDYL_LIBRARIES}
optimization
Eigen3::Eigen
dynobench::dynobench
fcl
yaml-cpp
Boost::program_options
Boost::serialization)
target_link_libraries(
main_multirobot_optimization
PRIVATE ${CROCODDYL_LIBRARIES}
optimization
Eigen3::Eigen
dynobench::dynobench
fcl
yaml-cpp
Boost::program_options
Boost::serialization)
target_link_libraries(
main_tdbastar
PUBLIC Eigen3::Eigen tdbastar
PRIVATE fcl dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
Boost::serialization ${LZ4_LIBRARIES})
# for tdb-A*
add_library(idbastar::tdbastar ALIAS tdbastar) # for use in test folder
target_include_directories(
tdbastar
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${OMPL_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/nigh/src)
target_link_libraries(
tdbastar
PUBLIC Eigen3::Eigen dynobench::dynobench
PRIVATE fcl ${OMPL_LIBRARIES} ${LZ4_LIBRARIES})
# target_link_libraries( main_tdbastar PUBLIC Eigen3::Eigen tdbastar PRIVATE fcl
# dynobench::dynobench ${OMPL_LIBRARIES} Boost::program_options
# Boost::serialization ${LZ4_LIBRARIES})
enable_testing()
add_subdirectory(test)