forked from philip-long/robot_collision_checking
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
138 lines (117 loc) · 2.86 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
cmake_minimum_required(VERSION 3.5)
project(robot_collision_checking)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(geometric_shapes REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(nav2_voxel_grid REQUIRED)
find_package(octomap_msgs REQUIRED)
find_package(shape_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
## System dependencies are found with CMake's conventions
find_package(CCD REQUIRED)
find_package(FCL 0.7.0 REQUIRED)
if(FCL_VERSION VERSION_LESS "0.7.0")
message(WARNING "Your FCL version ${FCL_VERSION} is less than 0.7.0")
else()
message(STATUS "FCL version ${FCL_VERSION} is good!")
endif()
find_package(Eigen3 REQUIRED)
find_package(octomap REQUIRED)
add_definitions(-DOCTOMAP_NODEBUGOUT)
### Libraries and executables ###
include_directories(
include
${Eigen3_INCLUDE_DIRS}
${FCL_INCLUDE_DIRS}
${CCD_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS}
)
set(dependencies
rclcpp
rclpy
geometry_msgs
geometric_shapes
nav2_costmap_2d
nav2_msgs
nav2_voxel_grid
octomap_msgs
shape_msgs
std_msgs
visualization_msgs
)
add_library(fcl_interface SHARED
src/fcl_interface.cpp
src/fcl_interface_collision_world.cpp
)
target_link_libraries(fcl_interface
${Eigen3_LIBRARIES}
${FCL_LIBRARIES}
${CCD_LIBRARIES}
${OCTOMAP_LIBRARIES}
)
ament_target_dependencies(fcl_interface
${dependencies}
)
add_executable(fcl_interface_example
examples/fcl_interface_example.cpp
)
target_link_libraries(fcl_interface_example
fcl_interface
)
ament_target_dependencies(fcl_interface_example
${dependencies}
)
### Install ###
install(TARGETS fcl_interface
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(TARGETS fcl_interface_example
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include/
DESTINATION include/
)
### Testing ###
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
# FCL interface test
ament_add_gtest(interface_test test/interface_test.cpp)
target_include_directories(interface_test PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
ament_target_dependencies(interface_test
${dependencies}
)
target_link_libraries(interface_test fcl_interface)
endif()
### Ament stuff ###
ament_export_include_directories(include)
ament_export_libraries(fcl_interface)
ament_export_dependencies(
${dependencies}
CCD
FCL
Eigen
octomap
)
ament_package()