Skip to content
Snippets Groups Projects
Unverified Commit 28bb42e5 authored by Amin Bandali's avatar Amin Bandali Committed by Maxim Cournoyer
Browse files

cmake: Tweak RPATH to fix linking libjami for local installs.

* CMakeLists.txt: Tweak the setting of the runtime path (RPATH) to add
the 'lib' directory for local (non-system-wide) installs, to fix the
newly-surfaced issue with linking libjami for local installs.

Without this, the executable would be linked against the libjami
shared library from daemon/src/.libs for the install RPATH as well,
which for some reason as of recently gets omitted from the install
RPATH after 'make install', resulting in an error like the following
when trying to launch jami:

./install/bin/jami: error while loading shared libraries: libjami.so.0: cannot open shared object file: No such file or directory

Change-Id: If7e172b54728c72ae649fcf936a767b5d9c99488
parent cd7a3199
No related branches found
No related tags found
No related merge requests found
......@@ -111,8 +111,20 @@ endif()
set(CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS} ${Qt6Widgets_EXECUTABLE_COMPILE_FLAGS})
# Add the auto-determined directories (those that are in the linker
# search path or contain linked libraries) outside the build tree to
# the RPATH.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
# # Augment the install RPATH for local (non-global) installs.
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/lib"
isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
if (WITH_DAEMON_SUBMODULE AND NOT EXISTS ${DAEMON_DIR}/src)
message(FATAL_ERROR
"Jami Daemon sources not found in ${DAEMON_DIR}/src. If you \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment