iceoryx
iceoryx copied to clipboard
Setting RPATH for iceoryx artifacts
Brief feature description
Setting the RPATH in cmake makes it easier to use iceoryx build as dynamic lib since the path to the lib will be stored in RouDi and the examples.
Detailed information
Building iceoryx as dynamic lib and using it is cumbersome since one has to add the installation path to the LD_LIBRARY_PATH
/DYLD_LIBRARY_PATH
. Setting the RPATH removes this additional step by embedding the path to the libraries inside the binaries.
Additional information:
- https://dev.my-gate.net/2021/08/04/understanding-rpath-with-cmake/
- https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
Instead of setting the absolute path with ${CMAKE_INSTALL_PREFIX}/lib
we should consider using relative paths like $ORIGIN/../${CMAKE_INSTALL_LIBDIR}
or @loader_path/../${CMAKE_INSTALL_LIBDIR}
on macOS. This has the advantage that the install directory can be copied and the binaries still find the correct libraries
Todo
- [ ] Refactor all
CMakeLists.txt
so that they use the iceoryx wrappersiox_add_library
oriox_add_executable
- [ ] Set
RPATH
in the iceoryx wrappers correctly - [ ] Remove compiler warning exceptions for tests in cmake (
-Wno-pedantic -Wno-conversion
) - [ ] Adjust build destination for all iceoryx modules (destination should be equal to project name, see
iceoryx_posh
is build inbuild/posh
. - [ ] Set correct stack size for
APPLE
platform iniox_add_executable
. - [ ] Implement
RPATH
auto detection to solve posh dependencies in hoofs. See comment: https://github.com/eclipse-iceoryx/iceoryx/pull/1357#discussion_r875731112
@elfenpiff is this really finished? There are some open tasks
@elfenpiff It seems the PR for this issue broke the installation of the header. The iceoryx_posh
header are installed in include
and include/iceoryx/v2.90.0
. The iceoryx_dds
header are installed in include
. Everything should be in include/iceoryx/v2.90.0
.
Additionally the tests are also installed. This is different from before the changes. Not sure if they should also be installed.
Reopening due to the duplicate installation of ìceoryx_posh