Skip to content

Conversation

ShamrockLee
Copy link

🦟 Bug fix

Fixes #

Summary

This PR fixes the *.cmake file install path inconsistency between gz-cmake and other Gazebo library projects.

Gazebo library projects use the gz-cmake's GzConfigureBuild.cmake to decide on the install paths of each files, which installs the *.cmake files under the
lib/cmake directory. However, gz-cmake currently install its own *.cmake file under the share/cmake directory, contradicting its own standard.

If merged, the *.cmake file install paths of gz-cmake will be lib/*.cmake ("${GZ_LIB_INSTALL_DIR}/cmake/${target_name}"), making it discoverable by other Gazebo library projects without special configurations.

I'm currently packaging the Gazebo libraries for Nixpkgs, and this change fixes the build of dependent packages like gz-utils.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

🎉 New feature

Closes #

Summary

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

➡️ Forward port

Port <FROM_BRANCH> to <TO_BRANCH>

Branch comparison: https://github.com/gazebosim//compare/<TO_BRANCH>...<FROM_BRANCH>

Note to maintainers: Remember to Merge with commit (not squash-merge or rebase)

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

🎈 Release

Preparation for <X.Y.Z> release.

Comparison to <x.y.z>: https://github.com/gazebosim//compare/<LATEST_TAG_BRANCH>...<RELEASE_BRANCH>

Needed by <PR(s)>

Checklist

  • Asked team if this is a good time for a release
  • There are no changes to be ported from the previous major version
  • No PRs targeted at this major version are close to getting in
  • Bumped minor for new features, patch for bug fixes
  • Updated changelog
  • Updated migration guide (as needed)
  • Link to PR updating dependency versions in appropriate repository in gazebo-release (as needed):

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.

Fix the *.cmake file install path inconsistency
between gz-cmake and other Gazebo library projects.

Gazebo library projects use the gz-cmake's GzConfigureBuild.cmake
to decide on the install paths of each files,
which installs the *.cmake files under the
lib/cmake/<project name> directory.

However, gz-cmake currently install its own *.cmake file under the
share/cmake directory, contradicting its own standard.

If merged, the *.cmake file install paths of gz-cmake will be
lib/*.cmake ("${GZ_LIB_INSTALL_DIR}/cmake/${target_name}"),
making it discoverable by other Gazebo library projects
without special configurations.

Signed-off-by: Yueh-Shun Li <shamrocklee@posteo.net>
@j-rivero
Copy link
Contributor

j-rivero commented Apr 2, 2025

Thanks for the PR. gz-cmake is a pure CMake project and architecture independent. If I'm not wrong the right place for them according to FHS is to place them under /usr/share. Other CMake files across the different libraries include paths to libraries that are architecture dependent and as such they go into /usr/lib.

What problem are you having placing them under /usr/share? It does not work out-of-the-box for your use of CMake?

@scpeters
Copy link
Member

scpeters commented Apr 5, 2025

Thanks for the PR. gz-cmake is a pure CMake project and architecture independent. If I'm not wrong the right place for them according to FHS is to place them under /usr/share. Other CMake files across the different libraries include paths to libraries that are architecture dependent and as such they go into /usr/lib.

What problem are you having placing them under /usr/share? It does not work out-of-the-box for your use of CMake?

I agree with @j-rivero; cmake find_package supports finding cmake config files in both of these locations:

If you'd like another idea for how to make a contribution, please consider enabling some CI checks for Ubuntu Noble on our Ionic branches (gazebo-tooling/release-tools#1222). You could, for example, replicate the changes in gazebosim/sdformat#1521 for gz-plugin by modifying the following file:

@ShamrockLee
Copy link
Author

Thanks for the PR. gz-cmake is a pure CMake project and architecture independent. If I'm not wrong the right place for them according to FHS is to place them under /usr/share. Other CMake files across the different libraries include paths to libraries that are architecture dependent and as such they go into /usr/lib.

That sounds reasonable. Maybe it's an issue that needs to be handled from the Nixpkgs side.

@j-rivero
Copy link
Contributor

That sounds reasonable. Maybe it's an issue that needs to be handled from the Nixpkgs side.

Thanks Sam, closing this for now.

@j-rivero j-rivero closed this Apr 11, 2025
@github-project-automation github-project-automation bot moved this from Inbox to Done in Core development Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants