From e60a4f921fa98ba5954e6ba6e8b7b77f912304f9 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Wed, 3 Dec 2025 14:44:50 +0100 Subject: [PATCH 1/2] CMake: Harden yaml-cpp usage After `find_package`'ing `yaml_cpp_vendor`, explicitly find also `yaml-cpp`, and link the correct target. --- canopen_core/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/canopen_core/CMakeLists.txt b/canopen_core/CMakeLists.txt index 33eb0df38..ece58dc5c 100644 --- a/canopen_core/CMakeLists.txt +++ b/canopen_core/CMakeLists.txt @@ -26,6 +26,7 @@ find_package(rclcpp REQUIRED) find_package(rclcpp_components REQUIRED) find_package(rclcpp_lifecycle REQUIRED) find_package(yaml_cpp_vendor REQUIRED) +find_package(yaml-cpp REQUIRED) include(ConfigExtras.cmake) set(dependencies @@ -56,10 +57,12 @@ ament_target_dependencies(node_canopen_driver rclcpp rclcpp_lifecycle lely_core_libraries - yaml_cpp_vendor canopen_interfaces Boost ) +target_link_libraries(node_canopen_driver + yaml-cpp::yaml-cpp +) add_library(node_canopen_master SHARED @@ -77,11 +80,12 @@ ament_target_dependencies(node_canopen_master rclcpp rclcpp_lifecycle lely_core_libraries - yaml_cpp_vendor canopen_interfaces Boost ) - +target_link_libraries(node_canopen_master + yaml-cpp::yaml-cpp +) add_library(device_container SHARED @@ -107,7 +111,7 @@ ament_target_dependencies(device_container target_link_libraries(device_container node_canopen_master node_canopen_driver - yaml-cpp + yaml-cpp::yaml-cpp ) add_executable(device_container_node From 45b93040073898d248da00aab4efde7878f1b561 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Wed, 3 Dec 2025 15:10:07 +0100 Subject: [PATCH 2/2] Apply suggestion from @roncapat --- canopen_core/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/canopen_core/CMakeLists.txt b/canopen_core/CMakeLists.txt index ece58dc5c..39a7c2e5c 100644 --- a/canopen_core/CMakeLists.txt +++ b/canopen_core/CMakeLists.txt @@ -57,6 +57,8 @@ ament_target_dependencies(node_canopen_driver rclcpp rclcpp_lifecycle lely_core_libraries + yaml_cpp_vendor + yaml-cpp canopen_interfaces Boost )