Include GNUInstallDirs to set CMAKE_INSTALL_LIBDIR for MacOS builds #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue is that when building on MacOS, the installation rpath is always set to
@loader_path/..
which causes the lookup to look in<install-prefix>/lib/..
and this doesn't work. The default path is related toCMAKE_INSTALL_LIBDIR
, so by includingGNUInstallDirs
CMAKE_INSTALL_LIBDIR
gets set tolib
and then the rpath becomes@loader_path/../lib
which works.Before
After
BEGINRELEASENOTES
k4MarlinWrapper
ENDRELEASENOTES
I tried adding
Key4hepConfig.cmake
but that didn't change anything. I wonder if passing libraries by full paths instead of cmake targets is the cause since I haven't seen this issue for other packages.With iLCSoft/GEAR#14 I was able to build
k4MarlinWrapper
on MacOS.