From 78d55e70797c8f9843b7424b1e8c184c46d63084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 20 Nov 2019 11:55:23 -0700 Subject: [PATCH 1/2] Set the proper RPATH for installed libraries --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 793d834fa9..95d6a34cae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,10 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Find includes in the build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) +if(NOT APPLE) + set(CMAKE_INSTALL_RPATH $ORIGIN) +endif() + # Common Includes for JKQtPlotter include(jkqtplotter_common_include) From 910d8641b57d0bd676d7276371fbe966ac2ea9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 21 Nov 2019 09:07:25 -0700 Subject: [PATCH 2/2] Move the setting to a dedicated CMake file --- CMakeLists.txt | 4 ---- cmake/jkqtplotter_common_compilersettings.cmake | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95d6a34cae..793d834fa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,10 +6,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # Find includes in the build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(NOT APPLE) - set(CMAKE_INSTALL_RPATH $ORIGIN) -endif() - # Common Includes for JKQtPlotter include(jkqtplotter_common_include) diff --git a/cmake/jkqtplotter_common_compilersettings.cmake b/cmake/jkqtplotter_common_compilersettings.cmake index 26227dbda4..30555875dd 100644 --- a/cmake/jkqtplotter_common_compilersettings.cmake +++ b/cmake/jkqtplotter_common_compilersettings.cmake @@ -16,3 +16,7 @@ elseif(MSVC) # have reference type and must not be parenthesized add_definitions(/D_CRT_NO_VA_START_VALIDATION) endif() + +if(NOT APPLE) + set(CMAKE_INSTALL_RPATH $ORIGIN) +endif()