-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
195 lines (153 loc) · 4.19 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
cmake_minimum_required(VERSION 3.5.1)
set (CMAKE_CXX_STANDARD 20)
project(coverage_planner)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
grid_map_ros
grid_map_cv
grid_map_core
grid_map_msgs
grid_map_visualization
grid_map_rviz_plugin
m545_path_utils
cv_bridge
)
###################################
## 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
catkin_package(
INCLUDE_DIRS include
LIBRARIES coverage_planner
CATKIN_DEPENDS
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
add_library(${PROJECT_NAME}
src/CellDecompBsd.cpp
src/Cell.cpp
src/Graph.cpp
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
)
add_executable(image_to_gridmap
src/image_to_gridmap_node.cpp
src/ImageToGridmap.cpp
)
target_link_libraries(image_to_gridmap
${catkin_LIBRARIES}
)
add_executable(create_desired_map
src/create_desired_map.cpp)
target_link_libraries(create_desired_map
${catkin_LIBRARIES})
add_executable(load_map_bag
test/load_map_bag.cpp
)
target_link_libraries(load_map_bag
${catkin_LIBRARIES}
)
add_executable(publish_map_bag
test/publish_map_bag.cpp
)
target_link_libraries(publish_map_bag
${catkin_LIBRARIES}
)
#############
## Install ##
#############
catkin_install_python(
PROGRAMS scripts/image_publisher.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# Mark executables and/or libraries for installation
install(
TARGETS
${PROJECT_NAME}
image_to_gridmap
load_map_bag
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# Mark cpp header files for installation
install(
DIRECTORY
include/${PROJECT_NAME}/
config
data
launch
rviz
scripts
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp"
)
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
if(CATKIN_ENABLE_TESTING)
catkin_add_gtest(${PROJECT_NAME}-test
test/bsd_test.cpp
test/test_cells.cpp
test/graph_test.cpp
test/decomp_test_map.cpp
)
target_include_directories(${PROJECT_NAME}-test PRIVATE
include
)
target_include_directories(${PROJECT_NAME}-test SYSTEM PUBLIC
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# catkin_add_gtest(${PROJECT_NAME}-test-vis
# test/decomp_test.cpp)
# target_include_directories(${PROJECT_NAME}-test-vis PRIVATE
# include
# )
# target_include_directories(${PROJECT_NAME}-test-vis SYSTEM PUBLIC
# ${catkin_INCLUDE_DIRS}
# ${EIGEN3_INCLUDE_DIR}
# )
# target_link_libraries(${PROJECT_NAME}-test-vis ${PROJECT_NAME})
# catkin_add_gtest(decomp_map-test
# test/decomp_test_map.cpp
# )
# target_include_directories(decomp_map-test PRIVATE
# include)
# target_include_directories(decomp_map-test SYSTEM PUBLIC
# ${catkin_INCLUDE_DIRS}
# ${EIGEN3_INCLUDE_DIR}
# )
# target_link_libraries(decomp_map-test ${PROJECT_NAME})
###################
## Code_coverage ##
###################
find_package(cmake_code_coverage QUIET)
if(cmake_code_coverage_FOUND)
add_gtest_coverage(
TEST_BUILD_TARGETS
${PROJECT_NAME}-test
)
endif()
endif()