gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
619 stars 251 forks source link

Use VERSION_GREATER_EQUAL in cmake logic #2418

Closed scpeters closed 1 month ago

scpeters commented 1 month ago

🦟 Bug fix

Small improvement to cmake logic

Summary

While updating cmake logic as part of https://github.com/gazebosim/gz-cmake/issues/350, I noticed a version comparison using STRGREATER when VERSION_GREATER_EQUAL looks more appropriate to me, since the feature was added in cmake 3.22.

cc @traversaro who added this in https://github.com/gazebosim/gz-sim/pull/1764

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 month ago

cc @traversaro who added this in #1764

Thanks for noticing! Yes, I guess ~I was just using something old out of habit.~ actually that was required at the time as we supporting also older versions of CMake.

traversaro commented 1 month ago

Yes, I guess ~I was just using something old out of habit.~ actually that was required at the time as we supporting also older versions of CMake.

Actually not, that operator is available since CMake 3.7: https://cmake.org/cmake/help/v3.10/command/if.html , so it was perfectly fine to use it also back then.