Skip to content

Commit 95ab3c5

Browse files
committed
[CMake] Append to CMAKE_INSTALL_RPATH with CACHE FORCE
Correctly append the additional RPATHs set by the ROOT build system to the `CMAKE_INSTALL_RPATH` variable set by the user, which is cached in `CMAKE_INSTALL_RPATH-CACHED` by the ROOT build system. Follows up on c77bd87. Closes #19134. Needs a backport to 6.36.
1 parent 556c00d commit 95ab3c5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmake/modules/RootBuildOptions.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,14 @@ if(rpath)
433433
if(APPLE)
434434
set(CMAKE_MACOSX_RPATH TRUE)
435435
set(CMAKE_INSTALL_NAME_DIR "@rpath")
436-
list(APPEND CMAKE_INSTALL_RPATH @loader_path @loader_path/${BINDIR_TO_LIBDIR})
436+
437+
set(_rpath_values "@loader_path" "@loader_path/${BINDIR_TO_LIBDIR}")
437438
else()
438-
list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/${BINDIR_TO_LIBDIR})
439+
set(_rpath_values "$ORIGIN" "$ORIGIN/${BINDIR_TO_LIBDIR}")
439440
endif()
440441

442+
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH-CACHED};${_rpath_values}" CACHE STRING "Install RPATH" FORCE)
443+
441444
unset(BINDIR_TO_LIBDIR)
442445
endif()
443446

0 commit comments

Comments
 (0)