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

Fix setup.sh and install dirs with absolute paths #3138

Merged
merged 1 commit into from
Dec 2, 2021

Conversation

lopsided98
Copy link
Contributor

#3061 introduced a similar problem to the one I fixed in #3076. CMAKE_INSTALL_*DIR can be absolute, so it cannot be concatenated with CMAKE_INSTALL_PREFIX. For setup.sh though, we still want to use relative paths if possible to keep it relocatable. I implemented this similarly to the pkgconfig file, using the join_paths function. With this patch, if the CMAKE_INSTALL_*DIR variables are relative, setup.sh uses paths relative to ${installPrefix} (as before), whereas if those variables are absolute, setup.sh contains absolute paths. The GAZEBO_*_PATH variables are made always absolute using CMAKE_INSTALL_FULL_*DIR, retaining the existing behavior. I haven't tested this on Windows, so you may want to verify that setup.bat still contains the correct values.

cc @scpeters

The build script made some assumptions that CMAKE_INSTALL_*DIR was relative,
which is not necessarily true. This commit fixes causes the plugins to be
installed to the correct location and fixes the paths in setup.sh for both the
relative and absolute cases.
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

thanks for the fix! Hopefully I'll remember next time how to do this properly so you won't need to fix it so frequently

@scpeters scpeters merged commit 791e7d9 into gazebosim:gazebo11 Dec 2, 2021
@lopsided98 lopsided98 deleted the cmake-absolute-paths branch December 2, 2021 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants