gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.2k stars 484 forks source link

Support for protobuf >= 22 by using find_package(Protobuf CONFIG) #3331

Closed traversaro closed 1 year ago

traversaro commented 1 year ago

🎉 New feature

Fix compatibility with protobuf >= 22, similar to https://github.com/gazebosim/gz-msgs/pull/346 and other PRs linked there.

Summary

To minimize the risk of regression when protobuf < 22 is used, the protobuf version is obtained via pkg-config. If protobuf >= 22 is detected, then find_package(Protobuf CONFIG REQUIRED) is used and protobuf::libprotobuf and protobuf::libprotobuf are linked to make sure that the dependency with abseil is correctly handled.

Test it

See conda-forge CI that now passes. Probably this PR can also be tested on homebrew that recently upgraded protobuf to 23.2, see https://github.com/Homebrew/homebrew-core/pull/132957 .

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

traversaro commented 1 year ago

This patch worked fine in https://github.com/conda-forge/gazebo-feedstock/pull/178 .

talregev commented 1 year ago

@traversaro, it seem you fix the windows issue. Are you going to merge it?

scpeters commented 1 year ago

I wanted to rerun CI now that the citadel bottles of gazebo11 dependencies are fixed, and I noticed a minor whitespace issue, so I pushed https://github.com/gazebosim/gazebo-classic/pull/3331/commits/c4674eee1ad234d4a74bafc1d3ec401b595d3d63 to rerun CI