From dcb1023999c4311e2b3b7fd2acb738e551cd4f1f Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Wed, 8 Sep 2021 10:41:15 +0500 Subject: [PATCH] BUILD: use rpath for locating dynamic libraries --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6edcc0f..fc0845ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,12 @@ endif() if(UNIX) include(GNUInstallDirs) + # + # use rpath for locating installed libraries + # + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + include(CheckIncludeFile) Check_Include_File(sys/auxv.h HAVE_SYS_AUXV) if(EXISTS "/lib/systemd/system")