forked from vandanamandlik/laser_assembler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
114 lines (96 loc) · 3.52 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
cmake_minimum_required(VERSION 3.5)
project(laser_assembler)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(rosidl_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(message_filters REQUIRED)
find_package(laser_geometry REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2 REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(filters REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME} "srv/AssembleScans.srv"
"srv/AssembleScans2.srv"
DEPENDENCIES builtin_interfaces sensor_msgs)
set(INCLUDE_DIRS include ${ament_cmake_INCLUDE_DIRS}
${rosidl_default_generators_INCLUDE_DIRS} ${signals_INCLUDE_DIRS}
${builtin_interfaces_INCLUDE_DIRS} ${rclcpp_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS}
${laser_geometry_INCLUDE_DIRS}
${tf2_ros_INCLUDE_DIRS} ${tf2_INCLUDE_DIRS}
${message_filters_INCLUDE_DIRS}
${rostest_INCLUDE_DIRS} ${system_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${filters_INCLUDE_DIRS})
include_directories(${INCLUDE_DIRS})
set(LIBS ${rclcpp_LIBRARIES} ${ament_cmake_LIBRARIES}
${rosidl_default_generators_LIBRARIES} ${signals_LIBRARIES}
${std_msgs_LIBRARIES}
${system_LIBRARIES} ${tf2_ros_LIBRARIES} ${tf2_LIBRARIES}
${laser_geometry_LIBRARIES}
${geometry_msgs_LIBRARIES}
${message_filters_LIBRARIES} ${sensor_msgs_LIBRARIES}
${filters_LIBRARIES})
add_executable(laser_scan_assembler src/laser_scan_assembler.cpp)
target_link_libraries(laser_scan_assembler ${LIBS})
rosidl_target_interfaces(laser_scan_assembler
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS laser_scan_assembler
DESTINATION lib/${PROJECT_NAME})
include_directories(include)
install(DIRECTORY "include/"
DESTINATION include)
install(TARGETS laser_scan_assembler
DESTINATION lib/${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include)
ament_export_include_directories(include)
ament_export_dependencies(rclcpp)
ament_export_dependencies(signals)
ament_export_dependencies(sensor_msgs)
ament_export_dependencies(tf2_ros)
ament_export_dependencies(tf2)
ament_export_dependencies(message_filters)
ament_export_dependencies(laser_geometry)
ament_export_include_directories(${INCLUDE_DIRS})
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
add_executable(dummy_scan_producer test/dummy_scan_producer.cpp)
target_link_libraries(dummy_scan_producer ${LIBS})
rosidl_target_interfaces(dummy_scan_producer
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS dummy_scan_producer
DESTINATION lib/${PROJECT_NAME})
ament_add_gtest(test_assembler test/test_assembler.cpp)
target_link_libraries(test_assembler ${LIBS})
rosidl_target_interfaces(test_assembler
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS test_assembler
DESTINATION lib/${PROJECT_NAME})
add_executable(periodic_snapshotter examples/periodic_snapshotter.cpp)
target_link_libraries(periodic_snapshotter ${LIBS})
rosidl_target_interfaces(periodic_snapshotter
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS periodic_snapshotter
DESTINATION lib/${PROJECT_NAME})
endif()
ament_package()