aboutsummaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorMichael Dickens <michael.dickens@ettus.com>2014-09-03 11:05:37 -0400
committerMartin Braun <martin.braun@ettus.com>2014-10-09 13:25:21 +0200
commitf07ce4dc32c64d306368b80395cc6084d844cebe (patch)
treedfc271ef74a9b1f6198b171e43cd90fc46c4002a /host/CMakeLists.txt
parenta41b6517bec23c73b5c7eadbd133f598f1f32554 (diff)
downloaduhd-f07ce4dc32c64d306368b80395cc6084d844cebe.tar.gz
uhd-f07ce4dc32c64d306368b80395cc6084d844cebe.tar.bz2
uhd-f07ce4dc32c64d306368b80395cc6084d844cebe.zip
cmake: On Apple only, set install name and use rpath correctly, if not already set.
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index b6ea29fc8..d9e5a2029 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -65,6 +65,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
########################################################################
INCLUDE(CheckCXXCompilerFlag)