Closed traversaro closed 4 months ago
Looks like CI is having issues on this one:
-- Configuring done
CMake Error at /usr/share/cmake/gz-cmake3/cmake3/GzUtils.cmake:214 (add_library):
Cannot find source file:
/github/workspace/build/include/gz/gui/gz-gui7_get_install_prefix_impl.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
/usr/share/cmake/gz-cmake3/cmake3/GzCreateCoreLibrary.cmake:104 (_gz_add_library_or_component)
include/gz/gui/CMakeLists.txt:48 (gz_create_core_library)
Yes apparently there is some strange interaction between the old CMake version available in Focal and the strange location of the gz_create_core_library
call in gz-gui as opposed to other gz-*, I will look into it.
@traversaro are you going to be able to iterate on this one?
@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.
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 gz-gui8
?
@traversaro does this need to be retargeted to
gz-gui8
?
Yes, I can do this in the next days.
@traversaro , friendly ping here. Do you plan to retarget your patch to gz-gui8
?
Yes, sorry, I just lost sight of the PR.
Ops, sorry for the noise @jennuine @caguero , actually the PR was already merged in gz-gui8 in https://github.com/gazebosim/gz-gui/pull/580 before your pings, so we can safely close this one!
🎉 New feature
Closes part of https://github.com/gazebosim/gz-sim/issues/626
Summary
This PR uses the changes introduced in gz-cmake3 in https://github.com/gazebosim/gz-cmake/pull/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 https://github.com/gazebosim/gz-cmake/pull/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.