From f07ce4dc32c64d306368b80395cc6084d844cebe Mon Sep 17 00:00:00 2001 From: Michael Dickens Date: Wed, 3 Sep 2014 11:05:37 -0400 Subject: cmake: On Apple only, set install name and use rpath correctly, if not already set. --- host/CMakeLists.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'host') diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index b6ea29fc8..d9e5a2029 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -64,6 +64,26 @@ SET(PKG_MAN_DIR share/man/man1) ######################################################################## INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +######################################################################## +# On Apple only, set install name and use rpath correctly, if not already set +######################################################################## +IF(APPLE) + IF(NOT CMAKE_INSTALL_NAME_DIR) + SET(CMAKE_INSTALL_NAME_DIR + ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE + PATH "Library Install Name Destination Directory" FORCE) + ENDIF(NOT CMAKE_INSTALL_NAME_DIR) + IF(NOT CMAKE_INSTALL_RPATH) + SET(CMAKE_INSTALL_RPATH + ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE + PATH "Library Install RPath" FORCE) + ENDIF(NOT CMAKE_INSTALL_RPATH) + IF(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE + BOOL "Do Build Using Library Install RPath" FORCE) + ENDIF(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) +ENDIF(APPLE) + ######################################################################## # Optional Compiler Flags ######################################################################## -- cgit v1.2.3