Skip to content

Conversation

@idesign0
Copy link

Summary

This PR improves the CMake build of webots_ros2_driver to support both Linux and macOS environments:

  • Detect prebuilt /Applications/Webots.app on macOS and link against its libraries.
  • Add support for source builds on macOS (similar to Linux).
  • Use file(GLOB …) for Webots libraries instead of hardcoded list.
  • Refactor Python version detection (humble/iron → 3.10, others → 3.12).
  • Switch from yaml-cpp to yaml_cpp_vendor for consistency with ROS 2.
  • Install Python packages only if directories exist.
  • Conditional add_dependencies only when not using prebuilt Webots.
  • webots-controller script installation now uses ${WEBOTS_CONTROLLER_EXEC}.

Motivation

These changes allow webots_ros2_driver to build on:

  • Linux with Webots source build
  • macOS with prebuilt Webots.app

Notes

@traversaro — I would greatly appreciate your guidance and feedback here. :)

Testing

  • ✅ macOS (Apple Clang) with Webots.app 2025a (prebuilt)
  • ✅ Ubuntu 22.04 with source Webots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants