ros2 / rosbag2

Apache License 2.0
285 stars 251 forks source link

[humble] rosbag2_storage linking to yaml-cpp::yaml-cpp #1831

Closed PizzocaroSolomon closed 1 month ago

PizzocaroSolomon commented 1 month ago

Hello everyone,

We have a project containing targets linking to rosbag2_storage and the standard yaml-cpp library.
During compilation, we get the following CMake warning:

image

We're certain that all our targets are linking to yaml-cpp using the target yaml-cpp::yaml-cpp.

Inside "/opt/ros/humble/share/rosbag2_storage/cmake/export_rosbag2_storageExport.cmake" we noticed the following lines:

set_target_properties(rosbag2_storage::rosbag2_storage PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/rosbag2_storage" INTERFACE_LINK_LIBRARIES "pluginlib::pluginlib;rcpputils::rcpputils;rcutils::rcutils;yaml-cpp" )

and substituting "yaml-cpp" with "yaml-cpp::yaml-cpp", the warning disappears.

We are convinced that this is a dirty solution to our problem. Do you have any suggestions on what we can do to remove the warning cleanly? Is it possible to add this "fix" to one of the next releases of ROS2 humble?

thank you very much!

clalancette commented 1 month ago

Closing as a duplicate of #1830.