forked from SteveMacenski/spatio_temporal_voxel_layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
136 lines (116 loc) · 3.73 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
cmake_minimum_required(VERSION 3.5)
project(spatio_temporal_voxel_layer)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
find_package(ament_cmake REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(pluginlib REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(laser_geometry REQUIRED)
find_package(message_filters REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(rclcpp REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_srvs REQUIRED)
find_package(OpenVDB REQUIRED)
find_package(TBB REQUIRED)
remove_definitions(-DDISABLE_LIBUSB-1.0)
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread)
find_package(PCL REQUIRED COMPONENTS filters common)
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
# This package fails to build on Debian Stretch with a linking error against
# 'Qt5::Widgets'. This is a transitive dependency that comes in to PCL via
# the PCL dependency on VTK. However, we don't actually care about the Qt
# dependencies for this package, so just remove them. This is similar to the
# workaround in https://github.com/ros-perception/perception_pcl/pull/151,
# and can be removed when Stretch goes out of support.
list(REMOVE_ITEM PCL_LIBRARIES
"vtkGUISupportQt"
"vtkGUISupportQtOpenGL"
"vtkGUISupportQtSQL"
"vtkGUISupportQtWebkit"
"vtkViewsQt"
"vtkRenderingQt")
endif()
set(dependencies
nav2_costmap_2d
geometry_msgs
pluginlib
sensor_msgs
std_msgs
std_srvs
laser_geometry
message_filters
pcl_conversions
rclcpp
tf2_ros
tf2_geometry_msgs
visualization_msgs
builtin_interfaces
)
set(library_name spatio_temporal_voxel_layer_core)
add_definitions(${EIGEN3_DEFINITIONS})
set(srv_files "srv/SaveGrid.srv")
rosidl_generate_interfaces(${PROJECT_NAME}
${srv_files}
DEPENDENCIES builtin_interfaces std_msgs
)
include_directories(
include
${BOOST_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${OpenVDB_INCLUDE_DIR}
${TBB_INCLUDE_DIRS}
)
add_library(${library_name} SHARED
src/spatio_temporal_voxel_layer.cpp
src/spatio_temporal_voxel_grid.cpp
src/measurement_buffer.cpp
src/frustum_models/depth_camera_frustum.cpp
src/frustum_models/three_dimensional_lidar_frustum.cpp
src/vdb2pc.cpp
)
rosidl_target_interfaces(${library_name} ${PROJECT_NAME} "rosidl_typesupport_cpp")
target_compile_definitions(${library_name} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
target_link_libraries(${library_name}
${Boost_LIBRARIES}
${EIGEN3_LIBRARIES}
${PCL_LIBRARIES}
${OpenVDB_LIBRARIES}
${TBB_LIBRARIES}
)
ament_target_dependencies(${library_name} ${dependencies})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
install(TARGETS ${library_name}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY example
DESTINATION share/${PROJECT_NAME}
)
install(FILES costmap_plugins.xml
DESTINATION share/${PROJECT_NAME}
)
ament_export_dependencies(rosidl_default_runtime)
pluginlib_export_plugin_description_file(nav2_costmap_2d costmap_plugins.xml)
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_package()