Skip to content

Commit

Permalink
Fix the verify_ROOT function which was not detecting a compatible ROO…
Browse files Browse the repository at this point in the history
…T on macOS.
  • Loading branch information
FonsRademakers committed Dec 14, 2024
1 parent ab8afa1 commit 5b145bf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,19 @@ function(verify_ROOT)
# check if SHA256 of installed ROOT is the same as the expected one
file(READ ${CMAKE_THIRD_PARTY_DIR}/root/tar-sha256 TAR_SHA256)
if(APPLE)
execute_process(COMMAND bash "-c" "xcodebuild -version | sed -En 's/Xcode[[:space:]]+([0-9\.]*)/\\1/p'" OUTPUT_VARIABLE XCODE_VERS)
if("${XCODE_VERS}" GREATER_EQUAL "14.1")
set(ROOT_SHA ${osx-xcode-14.1-${DETECTED_ARCH}-ROOT})
else()
set(ROOT_SHA ${osx-xcode-13.1-${DETECTED_ARCH}-ROOT})
endif()
execute_process(COMMAND bash "-c" "xcodebuild -version | sed -En 's/Xcode[[:space:]]+([0-9\.]*)/\\1/p' | tr -d '\\n'" OUTPUT_VARIABLE XCODE_VERS)
set(ROOT_SHA_KEY osx-xcode-${XCODE_VERS}-${DETECTED_ARCH}-ROOT)
else()
set(ROOT_SHA ${${DETECTED_OS_VERS}-ROOT})
set(ROOT_SHA_KEY ${DETECTED_OS_VERS}-ROOT)
endif()
set(ROOT_SHA ${${ROOT_SHA_KEY}})
if(NOT "${TAR_SHA256}" STREQUAL "${ROOT_SHA}")
# BDM installed ROOT has wrong SHA256... deleting it
message(WARNING "The found ROOT version is not compatible... deleting it...")
file(REMOVE_RECURSE ${CMAKE_THIRD_PARTY_DIR}/root)
unset(ROOT_FOUND)
else()
message(STATUS "Found a compatible ROOT version in ${CMAKE_THIRD_PARTY_DIR}/root")
endif()
else()
# BDM installed ROOT exists but no SHA256 file... deleting it
Expand Down

0 comments on commit 5b145bf

Please sign in to comment.