From f78aebda29d28e74e12e3e0988bf3e6c4792ecc6 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 7 Jan 2020 17:26:56 +0100 Subject: [PATCH] Set CMAKE_INSTALL_RPATH To easily run executables in `$DEST/bin`, depending on libraries in `$DEST/lib`. Signed-off-by: Laurent Bonnans --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70858b090b..fea96fe3c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,6 +213,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") endif () endif() +# helpful for debugging installed executables, see `man ld-linux.so` +set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib") + # prevent visibility warnings from the linker if (APPLE) link_libraries("-Wl,-w")