-
Notifications
You must be signed in to change notification settings - Fork 71
switch to using yaml_cpp_vendor #784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch to using yaml_cpp_vendor #784
Conversation
…the same as is used in core ros packages
| find_package(tf2_geometry_msgs REQUIRED) | ||
| find_package(tf2_ros REQUIRED) | ||
| find_package(yaml_cpp_vendor REQUIRED) | ||
| find_package(yaml-cpp REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This find_package is needed, see pattern used in other ros packages:
https://github.com/ros2/rviz/blob/rolling/rviz_common/CMakeLists.txt#L56-L57
https://github.com/ros-perception/image_common/blob/rolling/camera_calibration_parsers/CMakeLists.txt#L19-L20
https://github.com/ros2/rosbag2/blob/rolling/rosbag2_storage/CMakeLists.txt#L29-L30
swri_transform_util/CMakeLists.txt
Outdated
| opencv_imgproc | ||
| opencv_video | ||
| ${PROJ_LIBRARIES} | ||
| yaml-cpp::yaml-cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yaml-cpp::yaml-cpp is the correct target, the modern CMake target sets up include directories and link libraries, see conversation here: ros2/yaml_cpp_vendor#51 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that's only for Jazzy and later, and we'll have to add a switch for Humble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll put up another PR later today with a switch for the target
| tf2 | ||
| tf2_geometry_msgs | ||
| tf2_ros | ||
| yaml-cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yaml-cpp is the correct target to export, my understanding is yaml_cpp_vendor sets up the right hints to get the yaml-cpp find_package to find the vendored package, but the actual target is yaml-cpp.
In packages.xml, depending on yaml_cpp_vendor tells rosdep to look for the vendored package, if yaml-cpp is used rosdep will want to use the system package - but that causes problems on platforms that have a different yaml-cpp system version than the _vendor package.
Without the export of yaml-cpp, swri_route_util will not be able to find and link against yaml-cpp.
See the exports of rosbag2, they export both yaml-cpp and yaml_cpp_vendor - I don't think it's required to export yaml_cpp_vendor, but it doesn't hurt. Exporting yaml-cpp is required for downstream packages to link properly.
This change switches swri_transform_util to use yaml_cpp_vendor so that it will use the same version of yaml-cpp as is used by the core ros packages (e.g. camera_calibration_parsers, rviz, etc.) This is important for folks who are building from source on platforms that may have a different system version than the version ros wants.
We are on Ubuntu 22.04 which comes with yaml-cpp 0.7 and using ros2 jazzy which wants 0.8. Mixing versions can cause problems downstream.