|
| 1 | +cmake_minimum_required(VERSION 3.5) |
| 2 | +project(rmw_dds_common_typesupports) |
| 3 | + |
| 4 | +# Default to C99 |
| 5 | +if(NOT CMAKE_C_STANDARD) |
| 6 | + set(CMAKE_C_STANDARD 99) |
| 7 | +endif() |
| 8 | + |
| 9 | +# Default to C++14 |
| 10 | +if(NOT CMAKE_CXX_STANDARD) |
| 11 | + set(CMAKE_CXX_STANDARD 14) |
| 12 | +endif() |
| 13 | + |
| 14 | +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 15 | + add_compile_options(-Wall -Wextra -Wpedantic) |
| 16 | +endif() |
| 17 | + |
| 18 | +# find dependencies |
| 19 | +find_package(ament_cmake REQUIRED) |
| 20 | + |
| 21 | +# Load type support packages to make sure that they are installed |
| 22 | +find_package(rosidl_typesupport_fastrtps_c REQUIRED) |
| 23 | +find_package(rosidl_typesupport_fastrtps_cpp REQUIRED) |
| 24 | +find_package(rosidl_typesupport_introspection_c REQUIRED) |
| 25 | +find_package(rosidl_typesupport_introspection_cpp REQUIRED) |
| 26 | + |
| 27 | +# This is an hack to have the `rosidl_generate_interfaces()` function consider |
| 28 | +# all the type supports required by `rmw_connextdds` even though that RMW |
| 29 | +# implementation has not yet been registered. |
| 30 | +ament_index_register_resource(rmw_typesupport CONTENT |
| 31 | + "rosidl_typesupport_c;rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c;rosidl_typesupport_cpp;rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp") |
| 32 | + |
| 33 | + |
| 34 | +if(BUILD_TESTING) |
| 35 | + find_package(ament_lint_auto REQUIRED) |
| 36 | + # the following line skips the linter which checks for copyrights |
| 37 | + # uncomment the line when a copyright and license is not present in all source files |
| 38 | + #set(ament_cmake_copyright_FOUND TRUE) |
| 39 | + # the following line skips cpplint (only works in a git repo) |
| 40 | + # uncomment the line when this package is not in a git repo |
| 41 | + #set(ament_cmake_cpplint_FOUND TRUE) |
| 42 | + ament_lint_auto_find_test_dependencies() |
| 43 | +endif() |
| 44 | + |
| 45 | +ament_package() |
0 commit comments