From cca21882e51f89bfea83edf397f16a3c55bcc4de Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Wed, 20 Nov 2024 14:39:18 -0600 Subject: [PATCH] Set RPATH correctly for the targets (#772) --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fd6f9ac7..515970102 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,11 @@ cmake_minimum_required (VERSION 3.21 FATAL_ERROR) +# See here: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling +set(CMAKE_SKIP_BUILD_RPATH FALSE) +set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + #---[ CMake Config ]-------------------- set_property(GLOBAL PROPERTY USE_FOLDERS ON) set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")