-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
66 lines (56 loc) · 1.7 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
cmake_minimum_required(VERSION 3.5)
project(rtt_ros2_node)
# 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 -Wno-unused-parameter)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rtt_ros2 REQUIRED)
# setup targets
include_directories(include/orocos)
orocos_library(rtt_ros2_node
src/rtt_ros2_node.cpp
EXPORT ${PROJECT_NAME}
INCLUDES DESTINATION include/orocos
)
ament_target_dependencies(rtt_ros2_node rclcpp)
orocos_plugin(rtt_ros2_node_service
src/rtt_ros2_node_service.cpp
)
target_link_libraries(rtt_ros2_node_service rtt_ros2_node)
ament_target_dependencies(rtt_ros2_node_service rclcpp)
# install
install(
DIRECTORY include/
DESTINATION include
)
# linters
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
# export information to downstream packages
# ament_export_dependencies(rtt_ros2)
ament_export_dependencies(rclcpp)
ament_export_include_directories(include/orocos)
if(COMMAND ament_export_targets)
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
else()
ament_export_interfaces(${PROJECT_NAME} HAS_LIBRARY_TARGET)
endif()
# must be called *after* the targets to check exported libraries etc.
ament_package()
# orocos_generate_package() is deprecated for ROS 2.
# Prefer cmake target export and import instead, in combination with
# ament_export_interfaces() or ament_export_targets() when building with
# ament_cmake.
orocos_generate_package()