Skip to content

Commit e0f7cd6

Browse files
committed
fix(build): Fix recently broken rpath setting (#4618)
As part of the recent big python wheel merge, compiler.cmake got changed in a subtle way in how it sets CMAKE_INSTALL_RPATH. This broken iv for me on a Mac with dynamic libraries. Strangely (and I'm too lazy to chase down exactly why), oiiotool seems fine. So this was missed entirely by the CI, which never runs 'iv', since it's an interactive app. (Note to self: we should find some way to at least verify that it can execute as part of the testsuite.) Anyway, I believe that this change adds the install lib area back to the path, and it does seem to repair my ability to run iv on my end. --------- Signed-off-by: Larry Gritz <[email protected]>
1 parent 245b7b1 commit e0f7cd6

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

src/cmake/compiler.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ else ()
698698
else()
699699
set(BASEPOINT $ORIGIN)
700700
endif()
701-
set (CMAKE_INSTALL_RPATH ${BASEPOINT} ${BASEPOINT}/${CMAKE_INSTALL_LIBDIR})
701+
set (CMAKE_INSTALL_RPATH ${BASEPOINT}
702+
${BASEPOINT}/../${CMAKE_INSTALL_LIBDIR})
702703
endif ()
703704
# add the automatically determined parts of the RPATH that
704705
# point to directories outside the build tree to the install RPATH

src/cmake/fancy_add_executable.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ macro (fancy_add_executable)
5353
target_link_libraries (${_target_NAME} PRIVATE ${_target_LINK_LIBRARIES})
5454
target_link_libraries (${_target_NAME} PRIVATE ${PROFILER_LIBRARIES})
5555
set_target_properties (${_target_NAME} PROPERTIES FOLDER ${_target_FOLDER})
56-
if (SKBUILD)
57-
# The installed bin and lib directories are at the same level, so we
58-
# need to set the rpath to look for the libraries in ../lib
59-
set_target_properties (${_target_NAME} PROPERTIES
60-
INSTALL_RPATH "$<IF:$<BOOL:${APPLE}>,@loader_path,$ORIGIN>/../${CMAKE_INSTALL_LIBDIR}")
61-
endif ()
6256
check_is_enabled (INSTALL_${_target_NAME} _target_NAME_INSTALL_enabled)
6357
if (CMAKE_UNITY_BUILD AND UNITY_BUILD_MODE STREQUAL GROUP)
6458
set_source_files_properties(${_target_SRC} PROPERTIES

src/libutil/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ function (setup_oiio_util_library targetname)
107107

108108
if (SKBUILD)
109109
set (PYTHON_SITE_DIR .)
110-
set_target_properties (${targetname} PROPERTIES
111-
INSTALL_RPATH "$<IF:$<BOOL:${APPLE}>,@loader_path,$ORIGIN>/${CMAKE_INSTALL_LIBDIR}")
112110
install_targets (NAMELINK_SKIP ${targetname})
113111
else ()
114112
install_targets (${targetname})

0 commit comments

Comments
 (0)