-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
81 lines (66 loc) · 2.58 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
cmake_minimum_required(VERSION 2.8.3)
project(laser_scan_matcher)
# List C++ dependencies on ros packages
set( ROS_CXX_DEPENDENCIES
roscpp
nodelet
sensor_msgs
tf
pcl_ros
pcl_conversions
geometry_msgs
nav_msgs
)
# Find catkin and all required ROS components
find_package(catkin REQUIRED COMPONENTS ${ROS_CXX_DEPENDENCIES} rostest)
find_package(PCL REQUIRED QUIET)
# Find csm project
find_package(PkgConfig)
pkg_check_modules(csm REQUIRED csm)
# Set include directories
include_directories(include ${catkin_INCLUDE_DIRS} ${csm_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
link_directories(${csm_LIBRARY_DIRS})
# Declare info that other packages need to import library generated here
catkin_package(
INCLUDE_DIRS include
LIBRARIES laser_scan_matcher
CATKIN_DEPENDS ${ROS_CXX_DEPENDENCIES}
)
#Create library
add_library(laser_scan_matcher src/laser_scan_matcher.cpp)
#
add_library(laser_scan_matcher_odom src/laser_scan_matcher_odom.cpp)
#Note we don't link against pcl as we're using header-only parts of the library
target_link_libraries(laser_scan_matcher ${catkin_LIBRARIES} ${csm_LIBRARIES})
add_dependencies(laser_scan_matcher ${csm_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
#
target_link_libraries(laser_scan_matcher_odom ${catkin_LIBRARIES} ${csm_LIBRARIES})
add_dependencies(laser_scan_matcher_odom ${csm_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
#Create nodelet
add_library(laser_scan_matcher_nodelet src/laser_scan_matcher_nodelet.cpp)
target_link_libraries(laser_scan_matcher_nodelet laser_scan_matcher)
#Create node
add_executable(laser_scan_matcher_node src/laser_scan_matcher_node.cpp)
target_link_libraries(laser_scan_matcher_node laser_scan_matcher)
#
add_executable(laser_scan_matcher_odom_node src/laser_scan_matcher_odom_node.cpp)
target_link_libraries(laser_scan_matcher_odom_node laser_scan_matcher_odom)
#Install library
install(TARGETS laser_scan_matcher laser_scan_matcher_nodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
#Install library includes
install(DIRECTORY include/laser_scan_matcher/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} )
#Install node
install(TARGETS laser_scan_matcher_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )
#Install nodelet description
install(FILES laser_scan_matcher_nodelet.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} )
#Install demo files
install(DIRECTORY demo
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} )
add_rostest(test/run.test)
add_rostest(test/covariance.test)