forked from whoenig/libMultiRobotPlanning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
176 lines (151 loc) · 4.44 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
cmake_minimum_required(VERSION 3.5)
project(libMultiRobotPlanning)
find_package(Boost 1.58 REQUIRED COMPONENTS program_options)
find_package(PkgConfig)
pkg_check_modules(YamlCpp yaml-cpp)
# check if Doxygen is installed
find_package(Doxygen)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
# note the option ALL which allows to build the docs together with the application
add_custom_target( docs
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
# clang-tidy target (linter & static code analysis)
add_custom_target(clang-tidy
COMMAND CMAKE_EXPORT_COMPILE_COMMANDS=ON run-clang-tidy ${CMAKE_CURRENT_SOURCE_DIR})
# clang-format
set(ALL_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/a_star.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/a_star_epsilon.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/assignment.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/cbs.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/cbs_ta.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/ecbs.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/ecbs_ta.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/neighbor.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/next_best_assignment.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/planresult.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/libMultiRobotPlanning/sipp.hpp
${CMAKE_CURRENT_SOURCE_DIR}/example/a_star.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/a_star_epsilon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/assignment.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/cbs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/cbs_ta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/ecbs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/ecbs_ta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/mapf_prioritized_sipp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/next_best_assignment.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/shortest_path_heuristic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/shortest_path_heuristic.hpp
${CMAKE_CURRENT_SOURCE_DIR}/example/sipp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/example/timer.hpp
)
add_custom_target(clang-format
COMMAND clang-format -i ${ALL_SOURCE_FILES}
)
# tests
add_custom_target(run-test
COMMAND python3 -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/test
)
add_custom_target(everything
DEPENDS clang-format clang-tidy docs run-test
)
# Enable C++14 and warnings
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
# Creates compile database used by clang-tidy.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(
include
)
# Examples
## a_star
add_executable(a_star
example/a_star.cpp
)
target_link_libraries(a_star
${Boost_LIBRARIES}
)
## a_star_epsilon
add_executable(a_star_epsilon
example/a_star_epsilon.cpp
)
target_link_libraries(a_star_epsilon
${Boost_LIBRARIES}
)
## assignment
add_executable(assignment
example/assignment.cpp
)
target_link_libraries(assignment
${Boost_LIBRARIES}
)
## cbs
add_executable(cbs
example/cbs.cpp
)
target_link_libraries(cbs
${Boost_LIBRARIES}
yaml-cpp
)
## cbs_ta
add_executable(cbs_ta
example/cbs_ta.cpp
)
target_link_libraries(cbs_ta
${Boost_LIBRARIES}
yaml-cpp
)
## ecbs
add_executable(ecbs
example/ecbs.cpp
)
target_link_libraries(ecbs
${Boost_LIBRARIES}
yaml-cpp
)
## ecbs_ta
add_executable(ecbs_ta
example/ecbs_ta.cpp
)
target_link_libraries(ecbs_ta
${Boost_LIBRARIES}
yaml-cpp
)
## next_best_assignment
add_executable(next_best_assignment
example/next_best_assignment.cpp
)
target_link_libraries(next_best_assignment
${Boost_LIBRARIES}
yaml-cpp
)
## sipp
add_executable(sipp
example/sipp.cpp
)
target_link_libraries(sipp
${Boost_LIBRARIES}
yaml-cpp
)
## mapf_prioritized_sipp
add_executable(mapf_prioritized_sipp
example/mapf_prioritized_sipp.cpp
)
target_link_libraries(mapf_prioritized_sipp
${Boost_LIBRARIES}
yaml-cpp
)