diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2020-05-08 15:04:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 15:04:02 -0400 |
commit | db7123688da302d17ecaa8ee2f87c22f9bcd5b6d (patch) | |
tree | fa4094241f7f2acb1aea2a75dde51765d2582129 | |
parent | 26db5dff18a40b402d20a572953870aab549c5f2 (diff) | |
parent | 3cc1ffc93e1927c3e82510244e3376f63b6f0060 (diff) | |
download | spmc-db7123688da302d17ecaa8ee2f87c22f9bcd5b6d.tar.gz |
Merge pull request #34 from jhunkeler/fix-rpath
Fix RPATH generator on Darwin
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d2d1d89..fb2df13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,14 @@ include(CTest) include(CheckSymbolExists) set(CMAKE_C_STANDARD 99) -set(CMAKE_INSTALL_RPATH $ORIGIN/../lib) +set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) + +if (APPLE) + set(CMAKE_INSTALL_NAME_DIR "@rpath") + set(CMAKE_INSTALL_RPATH "@loader_path/../lib") +else() + set(CMAKE_INSTALL_RPATH $ORIGIN/../lib) +endif() enable_testing() check_symbol_exists(strsep string.h HAVE_STRSEP) |