Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CMAKE_STAGING_PREFIX for staging OGRE installation #861

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented May 10, 2022

To maintain build/install phasing correctly, this vendor package is installing the external project to a staging location, which is then
recursively copied to the final location during the vendor package's installation phase.

The mechanism by which we're currently telling the external project where to install to gives it the impression that that will be the final destination, and it embeds such paths in places like pkgconfig files.

The CMAKE_STAGING_PREFIX can be used to override all of the install() operations' targets while still telling the project where it will eventually end up, which is pretty much exactly what we're trying to do.

We should consider making this change in other vendor packages, but I'm trying it here first because the *.pc files it installs contain paths to the build directory and are currently useless (at best).

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

To maintain build/install phasing correctly, this vendor package is
installing the external project to a staging location, which is then
recursively copied to the final location during the vendor package's
installation phase.

The mechanism by which we're currently telling the external project
where to install to gives it the impression that that will be the final
destination, and it embeds such paths in places like pkgconfig files.

The CMAKE_STAGING_PREFIX can be used to override all of the `install()`
operations' targets while still telling the project where it will
eventually end up, which is pretty much exactly what we're trying to do.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay added the bug Something isn't working label May 10, 2022
@cottsay cottsay self-assigned this May 10, 2022
Comment on lines -204 to +205
${CMAKE_INSTALL_PREFIX}/opt/rviz_ogre_vendor
opt/rviz_ogre_vendor
Copy link
Member Author

@cottsay cottsay May 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the change is actually intended to accomplish the (sort of) opposite - to support CMAKE_STAGING_PREFIX during build of the vendor package itself. That isn't something we're currently trying to do, but it seems appropriate to not needlessly exclude that scenario given that we're relying on it functioning correctly here.

Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

Since the docs said it was for cross-compiling I initially wondered if CMAKE_STAGING_PREFIX would only do something if CMAKE_CROSSCOMPILING was set, but looking at the commit that added it it appears to always do something.

I built and ran RViz2 locally. I no longer see build directory paths in the pkg-config files.

@cottsay cottsay merged commit 47e91ee into ros2 Jun 10, 2022
@delete-merged-branch delete-merged-branch bot deleted the cottsay/ogre-staging branch June 10, 2022 01:22
@cottsay
Copy link
Member Author

cottsay commented Jun 10, 2022

@Mergifyio backport humble

mergify bot pushed a commit that referenced this pull request Jun 10, 2022
To maintain build/install phasing correctly, this vendor package is
installing the external project to a staging location, which is then
recursively copied to the final location during the vendor package's
installation phase.

The mechanism by which we're currently telling the external project
where to install to gives it the impression that that will be the final
destination, and it embeds such paths in places like pkgconfig files.

The CMAKE_STAGING_PREFIX can be used to override all of the `install()`
operations' targets while still telling the project where it will
eventually end up, which is pretty much exactly what we're trying to do.

Signed-off-by: Scott K Logan <logans@cottsay.net>
(cherry picked from commit 47e91ee)
@mergify
Copy link

mergify bot commented Jun 10, 2022

backport humble

✅ Backports have been created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants