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.
Specifying
cmake_minimum_required(VERSION 2.8.12)
triggerscmake
to fall-back to old behaviour wrt@rpath
on my recent macOS system - which in turn breaks linking. Build succeeds, but the binaries die withdyld
'sLibrary not loaded
error.https://cmake.org/cmake/help/latest/policy/CMP0042.html has a comment on
cmake
's changed default wrtMACOSX_RPATH
in versions >= 3.0.cmake_minimum_required(VERSION 3.0)
fixes the linking for me.If changing
cmake_minimum_required
breaks stuff for people there is another option:Instead add
set(CMAKE_MACOSX_RPATH ON)
early inCMakeLists.txt
.My
cmake
version from a freshbrew install cmake
is 3.28.1.make
fromxcode-select --install
is 3.81. macOS is 14.2.1.Superficial understanding of the involved mechanisms, so this may well be a local issue.