-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
60 lines (50 loc) · 1.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
cmake_minimum_required(VERSION 3.5)
project(rtt_ros2_idl)
# 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(ament_cmake_python REQUIRED)
find_package(rtt_ros2 REQUIRED)
# setup Python module
ament_python_install_package(${PROJECT_NAME}
PACKAGE_DIR src/${PROJECT_NAME}
)
# 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(rosidl_cmake)
ament_export_dependencies(rosidl_generator_cpp)
ament_export_dependencies(rosidl_typesupport_introspection_cpp)
ament_export_dependencies(rtt_ros2)
ament_export_include_directories(include/orocos)
# must be called *after* the targets to check exported libraries etc.
ament_package(
CONFIG_EXTRAS
cmake/${PROJECT_NAME}-extras.cmake.in
cmake/${PROJECT_NAME}-generate_typekit.cmake
)
# 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(
DEPENDS_TARGETS rtt_ros2
)