mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 20:21:32 +02:00
cmake: Explicitly specify Boost_ROOT
for Homebrew's package
On macOS, this change ensures that the Boost package is located at its real path rather than via the symlink in the default prefix.
This commit is contained in:
@@ -17,6 +17,18 @@ function(add_boost_if_needed)
|
||||
directory and other added INTERFACE properties.
|
||||
]=]
|
||||
|
||||
if(CMAKE_HOST_APPLE)
|
||||
find_program(HOMEBREW_EXECUTABLE brew)
|
||||
if(HOMEBREW_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND ${HOMEBREW_EXECUTABLE} --prefix boost
|
||||
OUTPUT_VARIABLE Boost_ROOT
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# We cannot rely on find_package(Boost ...) to work properly without
|
||||
# Boost_NO_BOOST_CMAKE set until we require a more recent Boost because
|
||||
# upstream did not ship proper CMake files until 1.82.0.
|
||||
|
Reference in New Issue
Block a user