Skip to content

Commit

Permalink
Attempt to set rpath for more common scenarios when people are buildi…
Browse files Browse the repository at this point in the history
…ng custom versions

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Jul 17, 2019
1 parent ba22a8e commit 10adf36
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions IlmBase/config/IlmBaseSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ set(ILMBASE_LIB_SUFFIX "-${ILMBASE_VERSION_API}" CACHE STRING "string added to t
# would use -lImath_static (or target_link_libraries(xxx IlmBase::Imath_static))
set(ILMBASE_STATIC_LIB_SUFFIX "_static" CACHE STRING "When building both static and shared, name to append to static library (in addition to normal suffix)")

# rpath related setup - if the user sets an install rpath
# then just use that, or otherwise set one for them
if(NOT CMAKE_INSTALL_RPATH)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
set(isSystemDir)
endif()

if(APPLE)
# TODO: Right now, this will make a framework for every library
# is that desired? Or should the framework be the set of libraries?
Expand Down
10 changes: 10 additions & 0 deletions OpenEXR/config/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ set(OPENEXR_LIB_SUFFIX "-${OPENEXR_VERSION_API}" CACHE STRING "string added to t
# would use -lImath_static (or target_link_libraries(xxx IlmBase::Imath_static))
set(OPENEXR_STATIC_LIB_SUFFIX "_static" CACHE STRING "When building both static and shared, name to append to static library (in addition to normal suffix)")

# rpath related setup - if the user sets an install rpath
# then just use that, or otherwise set one for them
if(NOT CMAKE_INSTALL_RPATH)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
set(isSystemDir)
endif()

if(APPLE)
# TODO: Right now, this will make a framework for every library
# is that desired? Or should the framework be the set of libraries?
Expand Down

0 comments on commit 10adf36

Please sign in to comment.