Skip to content

Commit

Permalink
Merge pull request #218 from traversaro/fixgazeborospluginsmacos
Browse files Browse the repository at this point in the history
Fix usage of Gazebo plugins as linked libraries on macOS
  • Loading branch information
traversaro authored Jun 14, 2024
2 parents 2bf4e8a + 6ccbe12 commit f230fc7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,23 @@ done

if [[ "${GZ_CLI_NAME_VARIANT}" == "origname" ]]; then
cp $PREFIX/bin/gz $PREFIX/bin/gz11
fi
fi

# Ensure that plugins are found as libraries linked by the linker
# in macos, see
# https://github.com/RoboStack/ros-noetic/issues/228
# https://github.com/RoboStack/ros-noetic/issues/462
# https://github.com/RoboStack/ros-humble/issues/185
# We do not symlink all the libraries as they do not have Gazebo-specific
# prefix, so we prefer to minimize the risk of clobbering, so we only symlink
# the one used in https://github.com/ros-simulation/gazebo_ros_pkgs/blob/f9e1a4607842afa5888ef01de31cd64a1e3e297f/gazebo_plugins/CMakeLists.txt
if [[ "${target_platform}" == osx-* ]]; then
ln -s $PREFIX/lib/gazebo-11/plugins/libCameraPlugin.dylib $PREFIX/lib/libCameraPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libElevatorPlugin.dylib $PREFIX/lib/libElevatorPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libMultiCameraPlugin.dylib $PREFIX/lib/libMultiCameraPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libDepthCameraPlugin.dylib $PREFIX/lib/libDepthCameraPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libGpuRayPlugin.dylib $PREFIX/lib/libGpuRayPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libHarnessPlugin.dylib $PREFIX/lib/libHarnessPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libWheelSlipPlugin.dylib $PREFIX/lib/libWheelSlipPlugin.dylib
ln -s $PREFIX/lib/gazebo-11/plugins/libRayPlugin.dylib $PREFIX/lib/libRayPlugin.dylib
fi
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "gazebo" %}
{% set version = "11.14.0" %}
{% set number = 13 %}
{% set number = 14 %}

{% if GZ_CLI_NAME_VARIANT == "origname" %}
{% set number = number + 200 %}
Expand Down Expand Up @@ -158,6 +158,7 @@ test:
- test -f $PREFIX/bin/gazebo # [unix]
- test -f $PREFIX/bin/gz # [unix and GZ_CLI_NAME_VARIANT == "origname"]
- test -f $PREFIX/bin/gz11 # [unix]
- test -f $PREFIX/lib/libCameraPlugin.dylib # [osx]
- gzserver --version | grep "Gazebo multi-robot simulator, version" # [unix]
- gzclient --version | grep "Gazebo multi-robot simulator, version" # [unix]
- gazebo --version | grep "Gazebo multi-robot simulator, version" # [unix]
Expand Down

0 comments on commit f230fc7

Please sign in to comment.