From 6a3b7eaed4f867c8dec45899eccd3cdad2158f38 Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Cordero Date: Fri, 17 Jul 2026 11:02:49 +0200 Subject: [PATCH] use C++ 20 in default Signed-off-by: Alejandro Hernandez Cordero --- pluginlib/CMakeLists.txt | 11 ++++------- pluginlib/package.xml | 2 ++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pluginlib/CMakeLists.txt b/pluginlib/CMakeLists.txt index 4e1c7bb..4290196 100644 --- a/pluginlib/CMakeLists.txt +++ b/pluginlib/CMakeLists.txt @@ -1,17 +1,12 @@ cmake_minimum_required(VERSION 3.20) project(pluginlib) -# Default to C++17 -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) -endif() - if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() find_package(ament_cmake REQUIRED) +find_package(ament_cmake_ros_core REQUIRED) find_package(ament_index_cpp REQUIRED) find_package(class_loader REQUIRED) find_package(rcutils REQUIRED) @@ -23,6 +18,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE "$" "$") target_link_libraries(${PROJECT_NAME} INTERFACE + ament_cmake_ros_core::ament_ros_defaults ament_index_cpp::ament_index_cpp class_loader::class_loader rcutils::rcutils @@ -41,7 +37,8 @@ install(TARGETS list_plugins DESTINATION lib/${PROJECT_NAME} ) -ament_export_dependencies(ament_index_cpp class_loader rcutils rcpputils TinyXML2) +ament_export_dependencies( + ament_cmake_ros_core ament_index_cpp class_loader rcutils rcpputils TinyXML2) # Export old-style CMake variables ament_export_include_directories("include/${PROJECT_NAME}") diff --git a/pluginlib/package.xml b/pluginlib/package.xml index 9e73316..484ae6b 100644 --- a/pluginlib/package.xml +++ b/pluginlib/package.xml @@ -22,6 +22,8 @@ Tully Foote ament_cmake + ament_cmake_ros_core + ament_cmake_ros_core ament_index_cpp class_loader