|
| 1 | +cmake_minimum_required(VERSION 3.5) |
| 2 | +project(tutorials) |
| 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 | + |
| 19 | +# Find and include all dependencies |
| 20 | +find_package(ament_cmake REQUIRED) |
| 21 | +find_package(ament_cmake_python REQUIRED) |
| 22 | +find_package(rclcpp REQUIRED) |
| 23 | +find_package(rclpy REQUIRED) |
| 24 | + |
| 25 | +# Include the core package |
| 26 | +find_package(core REQUIRED) |
| 27 | + |
| 28 | +# Include the include directory |
| 29 | +include_directories( |
| 30 | + include |
| 31 | + ${catkin_INCLUDE_DIRS} |
| 32 | + "${PROJECT_SOURCE_DIR}/include" |
| 33 | +) |
| 34 | + |
| 35 | +# C++ executables |
| 36 | +#add_executable(#name #source.cpp #dependency.cpp) |
| 37 | +#ament_target_dependencies(#name rclcpp core) |
| 38 | + |
| 39 | +# Add all the installation directories |
| 40 | +install(DIRECTORY |
| 41 | + #launch |
| 42 | + DESTINATION share/${PROJECT_NAME} |
| 43 | +) |
| 44 | + |
| 45 | +# Add all Python executables to this list |
| 46 | +install(PROGRAMS |
| 47 | + tutorials/example_publisher.py |
| 48 | + tutorials/example_subscriber.py |
| 49 | + tutorials/example_client.py |
| 50 | + tutorials/example_service.py |
| 51 | + DESTINATION lib/${PROJECT_NAME} |
| 52 | +) |
| 53 | + |
| 54 | + |
| 55 | +if(BUILD_TESTING) |
| 56 | + find_package(ament_lint_auto REQUIRED) |
| 57 | + # the following line skips the linter which checks for copyrights |
| 58 | + # uncomment the line when a copyright and license is not present in all source files |
| 59 | + #set(ament_cmake_copyright_FOUND TRUE) |
| 60 | + # the following line skips cpplint (only works in a git repo) |
| 61 | + # uncomment the line when this package is not in a git repo |
| 62 | + #set(ament_cmake_cpplint_FOUND TRUE) |
| 63 | + ament_lint_auto_find_test_dependencies() |
| 64 | +endif() |
| 65 | + |
| 66 | +ament_package() |
0 commit comments