Closed lms-ts closed 5 months ago
@lms-ts Could you please set the CMAKE_INSTALL_PREFIX
in the cmake build command to the directory you would like to install iceoryx to and check if this solves your issue?
@elfenpiff No, that does not solve the underlying issue.
With CMAKE_INSTALL_PREFIX
the _IMPORT_PREFIX
can be changed correctly however, it is still fixed in *Targets.cmake:
Example with -DCMAKE_INSTALL_PREFIX=/opt/sdk
=> set(_IMPORT_PREFIX "/opt/sdk")
This makes the installed packages not relocateable.
With the linked pull request the _IMPORT_PREFIX
is calculated relative to the *Targets.cmake file which makes the installation relocateable:
#iceoryx_platformTargets.cmake
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
Required information
Operating system: E.g. Ubuntu 22.04 LTS
Compiler version: GCC 11.4.0
Eclipse iceoryx version:
master
branchObserved result or behaviour: We created a Yocto recipe to cross-compile iceoryx:
It works but when installing the exported packages in an SDK and trying to use find_package() (e. g.
find_package(iceoryx_posh CONFIG REQUIRED)
) within CMakeLists.txt, it fails:The underlying problem is that the _IMPORT_PREFIX in the target import files is fixed and not relative to the installation path, e. g.:
Expected result or behaviour: Installed packages should be relocateable. The _IMPORT_PREFIX should be relative to the target import file.
Conditions where it occurred / Performed steps: Install iceoryx packages in a directory that differs from the standard installation directory used by the environment the project was built on.