diff options
| author | Mike Taves <mwtoews@gmail.com> | 2022-01-13 21:55:21 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-13 21:55:21 +1300 |
| commit | 69962fefc233ba06450b353073a2db4a9fce3ceb (patch) | |
| tree | 1c2fdc07d6172fc9f9d33c3d6615740bb6ad92c4 /src | |
| parent | 0e26f598ef4b4930dcf3344cf6a430c984e62385 (diff) | |
| download | PROJ-69962fefc233ba06450b353073a2db4a9fce3ceb.tar.gz PROJ-69962fefc233ba06450b353073a2db4a9fce3ceb.zip | |
Specify CMAKE_INSTALL_RPATH for macOS; use -rpath LDFLAGS for tests (#3009)
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 311cdbac..752d69f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,17 +23,14 @@ option(BUILD_PROJSYNC if(NOT MSVC) - if(NOT APPLE) - # Use relative path so that package is relocatable - set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${LIBDIR}") - else() + # Use relative path so that package is relocatable + if(APPLE) set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}") - # TO DO: cmake 2.8.12 introduces a way to make the install tree - # relocatable with OSX via - # (1) set(CMAKE_MACOSX_RPATH ON) and - # (2) setting the INSTALL_RPATH property on the executables to - # "@loader_path/../${LIBDIR}" + set(CMAKE_INSTALL_RPATH "@loader_path/../${LIBDIR}") + else() + set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${LIBDIR}") endif() + # Other apps can link to libproj using e.g. LDFLAGS -Wl,-rpath,${prefix}/lib else() |
