From aa916798d5484f96284fb3c089561cba850d7bf7 Mon Sep 17 00:00:00 2001 From: hrocho Date: Fri, 22 Sep 2017 12:05:35 +0200 Subject: [PATCH] cmake update for mac os --- CMakeLists.txt | 6 ++++++ init.sh.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 677bafb..99c6a61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR set(warnings "-Wall -Wextra -Werror") endif() +if(APPLE) + set(RPATH_VARIABLE "DYLD_LIBRARY_PATH") +else() + set(RPATH_VARIABLE "LD_LIBRARY_PATH") +endif() + ############# Requirements ################## find_package(GSL REQUIRED) diff --git a/init.sh.in b/init.sh.in index 26911c2..ca633dd 100644 --- a/init.sh.in +++ b/init.sh.in @@ -1,3 +1,3 @@ export CATIMAPATH=${PROJECT_BINARY_DIR} #export PATH=$PATH:$CATIMAPATH/bin -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATIMAPATH +export ${RPATH_VARIABLE}=$LD_LIBRARY_PATH:$CATIMAPATH