From 940c8a0b82cb07a0d35e93e1de624976e18e0565 Mon Sep 17 00:00:00 2001 From: Arseniy Shestakov Date: Fri, 8 Sep 2017 03:40:00 +0300 Subject: [PATCH] CMake: add $ORIGIN into RPATH for single-directory installation End up that single-directory installation is useful for Snap package. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41d1f7231..d9140306c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ option(ENABLE_PCH "Enable compilation using precompiled headers" ON) option(ENABLE_GITVERSION "Enable Version.cpp with Git commit hash" ON) option(ENABLE_DEBUG_CONSOLE "Enable debug console for Windows builds" ON) -# Useful for debugging +# Used for Snap packages and also useful for debugging option(ENABLE_MONOLITHIC_INSTALL "Install everything in single directory on Linux and Mac" OFF) # Allow to pass package name from Travis CI @@ -250,6 +250,7 @@ else() include(GNUInstallDirs) if(ENABLE_MONOLITHIC_INSTALL) + set(CMAKE_INSTALL_RPATH "$ORIGIN/") set(BIN_DIR "." CACHE STRING "Where to install binaries") set(LIB_DIR "." CACHE STRING "Where to install main library") set(DATA_DIR "." CACHE STRING "Where to install data files")