Skip to content

[cmake] Handle absolute install_dir in relative RPATH resolution#21786

Open
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:libdir_in_install_rpath
Open

[cmake] Handle absolute install_dir in relative RPATH resolution#21786
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:libdir_in_install_rpath

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented Apr 3, 2026

ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH assumed that install_dir is always relative to CMAKE_INSTALL_PREFIX when computing the relative path to CMAKE_INSTALL_FULL_LIBDIR. However, some build environments (e.g. Fedora or Nix) pass an absolute CMAKE_INSTALL_LIBDIR, which results in an incorrect relative path.

Fix this by detecting whether install_dir is absolute and using it directly as the base directory when computing the relative path.

Thanks to the ROOT/Nix user at GSI reporting this issue!

`ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH` assumed that `install_dir` is
always relative to `CMAKE_INSTALL_PREFIX` when computing the relative
path to `CMAKE_INSTALL_FULL_LIBDIR`. However, some build environments
(e.g. Fedora or Nix) pass an absolute `CMAKE_INSTALL_LIBDIR`, which
results in an incorrect relative path.

Fix this by detecting whether `install_dir` is absolute and using it
directly as the base directory when computing the relative path.
@guitargeek guitargeek requested a review from linev April 3, 2026 08:16
@guitargeek guitargeek self-assigned this Apr 3, 2026
@guitargeek guitargeek requested a review from bellenot as a code owner April 3, 2026 08:16
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Test Results

    22 files      22 suites   3d 7h 22m 40s ⏱️
 3 836 tests  3 834 ✅  1 💤 1 ❌
75 716 runs  75 697 ✅ 18 💤 1 ❌

For more details on these failures, see this check.

Results for commit f073c73.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant