-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
105 lines (85 loc) · 3.66 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
cmake_minimum_required(VERSION 2.8.3)
project(terrain_server)
# Finding external libraries
find_package(catkin REQUIRED COMPONENTS
dwl
dwl_msgs
roscpp
message_generation
std_msgs
geometry_msgs
octomap_msgs
std_srvs
tf
tf_conversions
pcl_ros)
find_package(octomap REQUIRED)
# Adding the message files
add_message_files(FILES TerrainCell.msg
TerrainMap.msg
Cell.msg
ObstacleMap.msg)
add_service_files(FILES TerrainData.srv)
# Generating the messages
generate_messages(DEPENDENCIES std_msgs
geometry_msgs
dwl_msgs)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp octomap_msgs message_runtime dwl)
# Setting flags for optimization
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_BUILD_TYPE "Release")
# Include directories
include_directories(include ${catkin_INCLUDE_DIRS}
${dwl_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS}
${dwl_LIBRARY_DIRS}
${OCTOMAP_LIBRARY_DIRS})
## Declare a cpp library
add_library(${PROJECT_NAME} src/TerrainMapInterface.cpp)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}
${dwl_LIBRARIES})
add_dependencies(${PROJECT_NAME} ${terrain_server_EXPORTED_TARGETS})
## Declare a cpp executable
add_executable(terrain_map_server src/TerrainMapServer.cpp
src/TerrainMapping.cpp
src/feature/SlopeFeature.cpp
src/feature/HeightDeviationFeature.cpp
src/feature/CurvatureFeature.cpp)
add_dependencies(terrain_map_server ${catkin_EXPORTED_TARGETS})
target_link_libraries(terrain_map_server ${catkin_LIBRARIES}
${dwl_LIBRARIES}
${OCTOMAP_LIBRARIES})
add_dependencies(terrain_map_server ${PROJECT_NAME}_gencpp)
add_executable(obstacle_map_server src/ObstacleMapServer.cpp)
add_dependencies(obstacle_map_server ${catkin_EXPORTED_TARGETS})
target_link_libraries(obstacle_map_server ${catkin_LIBRARIES}
${dwl_LIBRARIES}
${OCTOMAP_LIBRARIES})
add_dependencies(obstacle_map_server ${PROJECT_NAME}_gencpp)
add_executable(default_flat_terrain src/DefaultFlatTerrain.cpp)
add_dependencies(default_flat_terrain ${catkin_EXPORTED_TARGETS})
target_link_libraries(default_flat_terrain ${catkin_LIBRARIES}
${dwl_LIBRARIES}
${OCTOMAP_LIBRARIES})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/config/
DESTINATION DESTINATION share/${PROJECT_NAME}/config
FILES_MATCHING PATTERN "*.yaml*")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/launch/
DESTINATION DESTINATION share/${PROJECT_NAME}/launch
FILES_MATCHING PATTERN "*.*")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/msg/
DESTINATION DESTINATION share/${PROJECT_NAME}/msg
FILES_MATCHING PATTERN "*.*")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/srv/
DESTINATION DESTINATION share/${PROJECT_NAME}/srv
FILES_MATCHING PATTERN "*.*")
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install(TARGETS terrain_map_server obstacle_map_server default_flat_terrain RUNTIME DESTINATION lib/${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)