Skip to content

Commit

Permalink
Fix #461, issue with macos rpath support, remove half-baked framework…
Browse files Browse the repository at this point in the history
… support

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Jul 21, 2019
1 parent 119eb2d commit 9aa52c8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 44 deletions.
21 changes: 7 additions & 14 deletions IlmBase/config/IlmBaseSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# adds the automatically determined parts of the rpath
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
# if the user sets an install rpath
# then just use that, or otherwise set one for them
if(NOT CMAKE_INSTALL_RPATH)
Expand All @@ -78,27 +81,17 @@ if(NOT CMAKE_INSTALL_RPATH)
if(NOT tmpSysPath)
set(tmpSysPath "lib")
endif()
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath}:${CMAKE_INSTALL_FULL_LIBDIR}")
elseif(APPLE)
set(CMAKE_INSTALL_RPATH "@rpath:${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath};${CMAKE_INSTALL_FULL_LIBDIR}")
set(tmpSysPath)
elseif(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@executable_path/../lib;${CMAKE_INSTALL_FULL_LIBDIR}")
else()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
endif()
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?
# or trigger some compile-all-as-one-big-.so?
set(CMAKE_MACOSX_RPATH ON)
option(ILMBASE_BUILD_FRAMEWORK "Built Framework bundle" OFF)
if(ILMBASE_BUILD_FRAMEWORK)
set(BUILD_SHARED_LIBS ON)
endif()
endif()

########################

# set a default build type if not set
Expand Down
7 changes: 0 additions & 7 deletions IlmBase/config/LibraryDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ function(ILMBASE_DEFINE_LIBRARY libname)
OUTPUT_NAME "${libname}${ILMBASE_LIB_SUFFIX}"
)
endif()
if(ILMBASE_BUILD_FRAMEWORK)
set_target_properties(${libname} PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${ILMBASE_LIB_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER io.aswf.OpenEXR-IlmBase
)
endif()
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})

install(TARGETS ${libname}
Expand Down
7 changes: 0 additions & 7 deletions OpenEXR/config/LibraryDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ function(OPENEXR_DEFINE_LIBRARY libname)
OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}"
)
endif()
if(OPENEXR_BUILD_FRAMEWORK)
set_target_properties(${libname} PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${OPENEXR_LIB_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER io.aswf.OpenEXR
)
endif()
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})

install(TARGETS ${libname}
Expand Down
21 changes: 7 additions & 14 deletions OpenEXR/config/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# adds the automatically determined parts of the rpath
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
# if the user sets an install rpath
# then just use that, or otherwise set one for them
if(NOT CMAKE_INSTALL_RPATH)
Expand All @@ -72,27 +75,17 @@ if(NOT CMAKE_INSTALL_RPATH)
if(NOT tmpSysPath)
set(tmpSysPath "lib")
endif()
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath}:${CMAKE_INSTALL_FULL_LIBDIR}")
elseif(APPLE)
set(CMAKE_INSTALL_RPATH "@rpath:${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath};${CMAKE_INSTALL_FULL_LIBDIR}")
set(tmpSysPath)
elseif(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@executable_path/../lib;${CMAKE_INSTALL_FULL_LIBDIR}")
else()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
endif()
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?
# or trigger some compile-all-as-one-big-.so?
set(CMAKE_MACOSX_RPATH ON)
option(OPENEXR_BUILD_FRAMEWORK "Built Framework bundle" OFF)
if(OPENEXR_BUILD_FRAMEWORK)
set(BUILD_SHARED_LIBS ON)
endif()
endif()

########################

# set a default build type if not set
Expand Down
8 changes: 6 additions & 2 deletions PyIlmBase/config/PyIlmBaseSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# adds the automatically determined parts of the rpath
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
# if the user sets an install rpath
# then just use that, or otherwise set one for them
if(NOT CMAKE_INSTALL_RPATH)
Expand All @@ -61,9 +64,10 @@ if(NOT CMAKE_INSTALL_RPATH)
if(NOT tmpSysPath)
set(tmpSysPath "lib")
endif()
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath}:${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath};${CMAKE_INSTALL_FULL_LIBDIR}")
set(tmpSysPath)
elseif(APPLE)
set(CMAKE_INSTALL_RPATH "@rpath:${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@executable_path/../lib;${CMAKE_INSTALL_FULL_LIBDIR}")
else()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
endif()
Expand Down

0 comments on commit 9aa52c8

Please sign in to comment.