Skip to content

[v636][CMake] Set rpath for individual targets and not globally#19518

Merged
guitargeek merged 1 commit intoroot-project:v6-36-00-patchesfrom
guitargeek:bp_1
Aug 4, 2025
Merged

[v636][CMake] Set rpath for individual targets and not globally#19518
guitargeek merged 1 commit intoroot-project:v6-36-00-patchesfrom
guitargeek:bp_1

Conversation

@guitargeek
Copy link
Contributor

Backport of #19501 to fix the build errors on Spack and MacPorts with the next 6.36.04 patch release

When using the rpath=ON option, the global CMake variable CMAKE_INSTALL_RPATH is mutated, which is problematic in several corner cases.

This commit suggests to append the rpaths at the target property level, and also set the rpaths for the build tree separately so they make sense.

A new ROOT macro is introduced for this rpath setting, which are also used for the PyROOT libraries, which also need custom rpaths.

Closes #19327 and #19134.

When using the `rpath=ON` option, the global CMake variable
`CMAKE_INSTALL_RPATH` is mutated, which is problematic in several corner
cases.

This commit suggests to append the rpaths at the target property level,
and also set the rpaths for the build tree separately so they make
sense.

A new ROOT macro is introduced for this rpath setting, which are also
used for the PyROOT libraries, which also need custom rpaths.

Closes root-project#19327 and root-project#19134.
@github-actions
Copy link

github-actions bot commented Aug 4, 2025

Test Results

    18 files      18 suites   2d 20h 50m 39s ⏱️
 2 745 tests  2 744 ✅ 0 💤 1 ❌
47 753 runs  47 752 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 56f7254.

@guitargeek guitargeek merged commit 892e89c into root-project:v6-36-00-patches Aug 4, 2025
20 of 23 checks passed
@guitargeek guitargeek deleted the bp_1 branch August 4, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR in:Build System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant