forked from ros-perception/laser_filters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
102 lines (81 loc) · 3.5 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
cmake_minimum_required(VERSION 3.0.2)
project(laser_filters)
set(CMAKE_CXX_STANDARD 11)
##############################################################################
# Find dependencies
##############################################################################
set(THIS_PACKAGE_ROS_DEPS sensor_msgs roscpp tf filters message_filters
laser_geometry pluginlib angles dynamic_reconfigure)
find_package(catkin REQUIRED COMPONENTS ${THIS_PACKAGE_ROS_DEPS})
find_package(Boost REQUIRED COMPONENTS system)
include_directories(include src ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
##############################################################################
# Define package
##############################################################################
# dynamic reconfigure
generate_dynamic_reconfigure_options(
cfg/BoxFilter.cfg
cfg/IntensityFilter.cfg
cfg/PolygonFilter.cfg
cfg/ScanShadowsFilter.cfg
cfg/SpeckleFilter.cfg
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES pointcloud_filters laser_scan_filters
CATKIN_DEPENDS ${THIS_PACKAGE_ROS_DEPS}
DEPENDS
)
##############################################################################
# Build
##############################################################################
add_library(pointcloud_filters src/pointcloud_filters.cpp)
target_link_libraries(pointcloud_filters ${catkin_LIBRARIES})
add_library(laser_scan_filters
src/laser_scan_filters.cpp
src/median_filter.cpp
src/array_filter.cpp
src/box_filter.cpp
src/box_utils.cpp
src/multi_box_filter.cpp
src/polygon_filter.cpp
src/polygon_utils.cpp
src/speckle_filter.cpp
src/intensity_filter.cpp
)
target_link_libraries(laser_scan_filters ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_executable(scan_to_cloud_filter_chain src/scan_to_cloud_filter_chain.cpp)
target_link_libraries(scan_to_cloud_filter_chain ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_executable(scan_to_scan_filter_chain src/scan_to_scan_filter_chain.cpp)
target_link_libraries(scan_to_scan_filter_chain ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_executable(generic_laser_filter_node src/generic_laser_filter_node.cpp)
target_link_libraries(generic_laser_filter_node ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(laser_scan_filters ${PROJECT_NAME}_gencfg)
if (CATKIN_ENABLE_TESTING)
find_package(rostest)
add_executable(test_scan_filter_chain test/test_scan_filter_chain.cpp)
target_link_libraries(test_scan_filter_chain laser_scan_filters ${rostest_LIBRARIES} ${GTEST_LIBRARIES})
add_dependencies(test_scan_filter_chain gtest)
add_rostest(test/test_scan_filter_chain.launch)
add_rostest(test/test_polygon_filter.launch)
add_rostest(test/test_speckle_filter.launch)
catkin_add_gtest(test_shadow_detector test/test_shadow_detector.cpp)
target_link_libraries(test_shadow_detector ${catkin_LIBRARIES} ${rostest_LIBRARIES})
endif()
##############################################################################
# Install
##############################################################################
install(TARGETS pointcloud_filters laser_scan_filters
scan_to_cloud_filter_chain
scan_to_scan_filter_chain
generic_laser_filter_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# Install headers
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
install(FILES laser_filters_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)