Skip to content

Commit

Permalink
cmake: respect configuration of CMAKE_INSTALL_RPATH
Browse files Browse the repository at this point in the history
This will allow users to set this to a value more appropriate for their
installation.

This would be useful for us at Homebrew, for example, where we set this
to the appropriate value for Homebrew installations.[^1]

[^1]: https://github.com/Homebrew/homebrew-core/blob/a661bd4800424c1bfe7715d1c72c6566545cc2d6/Formula/mapserver.rb#L52
  • Loading branch information
carlocab authored and github-actions[bot] committed Jun 6, 2023
1 parent d84d3f1 commit 0a5d955
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Expand Up @@ -234,8 +234,10 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
endif()

SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(NOT DEFINED CMAKE_INSTALL_RPATH)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
SET(CMAKE_MACOSX_RPATH ON)

if(LINK_STATIC_LIBMAPSERVER)
Expand Down

0 comments on commit 0a5d955

Please sign in to comment.