Closed alerei closed 2 weeks ago
PR missing one of the required labels: {'enhancement', 'internal', 'new feature', 'documentation', 'bug', 'breaking-change', 'dependencies'}
PR missing one of the required labels: {'dependencies', 'internal', 'new feature', 'breaking-change', 'bug', 'enhancement', 'documentation'}
@alerei As far as I understand, this would make package non-relocatable, i.e it will no longer be possible to cross-compile it on host and install to target's sys root, since absolute paths will be different for host and target.
@DenisBiryukov91 Right, thanks for pointing that out as a use-case. I'll come up with another solution to the original issue and update this PR.
Revisiting the CMake docs the correct approach seems to be setting PATH_VARS in configure_package_config_file
. As a result, paths are built using CMake's internal PACKAGE_PREFIX_DIR
, which corresponds to what _IMPORT_PREFIX
was before.
This should build the correct relative paths, keeping the installed files relocatable.
@alerei LGTM, could you sign eclipse ECA to make corresponding ci check pass ?
@DenisBiryukov91 Done
Building and installing zenoh-c with
leads to the following error when building a dependent project that uses
find_package(zenohc 1.0.0 QUIET GLOBAL)
:~Calculating absolute paths from
_IMPORT_PREFIX
does not work as intended in that case as it makes assumptions about the relative location ofzenohcConfig.cmake
.~~I propose getting rid of
_IMPORT_PREFIX
entirely and rely onCMAKE_INSTALL_FULL_<dir>
instead as described in https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html~~Note that this requires introducing a new variable named
ZENOHC_INSTALL_FULL_DYLIBDIR
to account for the differences in the Win32 and Linux build.~