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 31 forks source link

GzConfigureProject: fix extras install #360

Closed scpeters closed 1 year ago

scpeters commented 1 year ago

🦟 Bug fix

Needed by https://github.com/gazebosim/gz-transport/pull/398, noticed while testing https://github.com/gazebo-release/gz-msgs10-release/pull/3

Summary

We have been fixing the debian metadata for gz-msgs10 in https://github.com/gazebo-release/gz-msgs10-release/pull/3, and I've built nightly debs from this branch successfully, but gz-transport fails to find the extra cmake files:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gz-msgs10/gz-msgs10-config.cmake:226 (include):
  include could not find requested file:

    /usr/lib/x86_64-linux-gnu/cmake/gz-msgs10/gz-msgs-extras.cmake
Call Stack (most recent call first):
  /usr/share/cmake/gz-cmake3/cmake3/GzFindPackage.cmake:243 (find_package)
  CMakeLists.txt:87 (gz_find_package)

Looking at the location of installed cmake files in libgz-msgs10-dev:

/usr/lib/cmake/gz-msgs10/gz-msgs-extras.cmake
/usr/lib/cmake/gz-msgs10/gz_msgs_factory.cmake
/usr/lib/cmake/gz-msgs10/gz_msgs_generate.cmake
/usr/lib/cmake/gz-msgs10/gz_msgs_protoc.cmake
/usr/lib/cmake/gz-msgs10/gz_msgs_string_utils.cmake
/usr/lib/cmake/gz-msgs10/target_link_messages.cmake
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10/gz-msgs10-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10/gz-msgs10-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10/gz-msgs10-targets-relwithdebinfo.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10/gz-msgs10-targets.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-all
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-all/gz-msgs10-all-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-all/gz-msgs10-all-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-all/gz-msgs10-all-targets.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-compiled
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-compiled/gz-msgs10-compiled-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-compiled/gz-msgs10-compiled-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-compiled/gz-msgs10-compiled-targets-relwithdebinfo.cmake
/usr/lib/x86_64-linux-gnu/cmake/gz-msgs10-compiled/gz-msgs10-compiled-targets.cmake

This changes the install location of the extra cmake files to use the CMAKE_INSTALL_LIBDIR variable, so that it matches the installation of the cmake config files.

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.

scpeters commented 1 year ago

I have found more issues, but I will open separate PRs for them