-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add optional binary relocatability #552
Conversation
Signed-off-by: Silvio Traversaro <silvio.traversaro@iit.it>
Looks like CI is having issues on this one:
|
Yes apparently there is some strange interaction between the old CMake version available in Focal and the strange location of the |
@traversaro are you going to be able to iterate on this one? |
I tried earlier today, but I was unable to find the solution. I think we can think of this some time after the code freeze/harmonic release. |
Sounds good, I'm going to remove the beta label for now. |
Yes, probably post-Harmonic release the easiest solution is to target harmonic for this, so we do not need to worry about Focal compatibility. |
@traversaro does this need to be retargeted to |
Yes, I can do this in the next days. |
@traversaro , friendly ping here. Do you plan to retarget your patch to |
Yes, sorry, I just lost sight of the PR. |
🎉 New feature
Closes part of gazebosim/gz-sim#626
Summary
This PR uses the changes introduced in gz-cmake3 in gazebosim/gz-cmake#334 to support the cmake installation directory to be moved after the
make install
prefix, and continue to work without the need to set any special environment variable, as long as the library is compiled as shared. To avoid regressions and problems in Ubuntu Focal due to the use of std::filesystem, this new behaviour is only activated if theGZ_ENABLE_RELOCATABLE_INSTALL
option is enabled, and its default value isOFF
.In particular, this PR defines a
gz::rendering::getPluginInstallDir()
that should be used in place of theGZ_GUI_PLUGIN_INSTALL_DIR
macros to ensure that the library is relocatable.Furthermore, this PR also deprecates the
GZ_GUI_PLUGIN_INSTALL_DIR
macro, using the strategy described in https://stackoverflow.com/a/29297970 . That strategy works fine on GCC and Clang, while on MSVC it raise a warning:However, I think that it does anyhow the job of raising some kind of warning, and then at soon as the developer checks the macro definition the kind of warning is clear.
Test it
The test should work as usual. The used CMake machinery is tested in gazebosim/gz-cmake#334 .
Checklist
codecheck
passed (See contributing)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.