gazebosim / gz-cmake

A set of CMake modules that are used by the C++-based Gazebo projects.
https://gazebosim.org/libs/cmake
Apache License 2.0
27 stars 30 forks source link

Use relative paths for pkg-config install directory #443

Closed azeey closed 3 months ago

azeey commented 3 months ago

🦟 Bug fix

Summary

This makes it so that all of our libraries use relative install paths and work well in build systems that don't set CMAKE_INSTALL_PREFIX.

gz_cmake_vendor is patched with this so it can build on the ROS buildfarm (see https://github.com/gazebo-release/gz_cmake_vendor/pull/4).

With this patch, running cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -P cmake_install.cmake from the build directory of any of our libraries will succeed showing that no absolute install destination is used.

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.