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

CMake: use find_package(PkgConfig) #3301

Closed traversaro closed 1 year ago

traversaro commented 1 year ago

🦟 Bug fix

Summary

Fix warning:

CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (gazebo).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:72 (include)
  /home/jrivero/code/ros2/ws_gazebo_ros_pkgs_jammy/install/gazebo_dev/share/gazebo_dev/cmake/gazebo_dev-extras.cmake:2 (find_package)
  /home/jrivero/code/ros2/ws_gazebo_ros_pkgs_jammy/install/gazebo_dev/share/gazebo_dev/cmake/gazebo_devConfig.cmake:41 (include)
  CMakeLists.txt:26 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.           

when find_package(gazebo) is called with CMake >= 3.22, see for example https://github.com/ros-simulation/gazebo_ros_pkgs/issues/1374 .

For more information on how Find***.cmake scripts work and how they are supposed to be used, check https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#find-modules .

In examples/stand_alone/arrange/CMakeLists.txt I simply removed the include(FindPkgConfig) as it was not used at all.

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.