From c0cb684bbfeac37d6da78eed623347b845e431ea Mon Sep 17 00:00:00 2001 From: Tobias Duswald Date: Tue, 21 Nov 2023 10:19:40 +0100 Subject: [PATCH 1/2] Add fatal for faulty XCode installation (#352) --- cmake/external/ROOT.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/external/ROOT.cmake b/cmake/external/ROOT.cmake index 659bc8cde..574d139c1 100644 --- a/cmake/external/ROOT.cmake +++ b/cmake/external/ROOT.cmake @@ -11,8 +11,18 @@ if(APPLE) "${DETECTED_OS_VERS}" MATCHES "^osx-12" OR "${DETECTED_OS_VERS}" MATCHES "^osx-11.6" OR "${DETECTED_OS_VERS}" MATCHES "^osx-11.7") + # Test if Xcode is installed via `xcodebuild -version`. + message(STATUS "##### Checking if XCODE is installed") + execute_process(COMMAND bash "-c" "xcodebuild -version" ERROR_VARIABLE XCODE_ERROR) + if("${XCODE_ERROR}" STREQUAL "") + message(STATUS "##### XCODE is installed") + else() + message(FATAL_ERROR "##### XCODE is not installed correctly. Please install XCODE (and then the command line tools). Consult issue #352 and the documentation") + endif() + # Determine XCDOE version execute_process(COMMAND bash "-c" "xcodebuild -version | sed -En 's/Xcode[[:space:]]+([0-9\.]*)/\\1/p'" OUTPUT_VARIABLE XCODE_VERS) message(STATUS "##### XCODE version: ${XCODE_VERS}") + # Set appropriate ROOT version depending on XCODE version if("${XCODE_VERS}" GREATER_EQUAL "14.3") message(STATUS "##### Using ROOT builds for XCODE 14.3") set(ROOT_TAR_FILE root_v6.29.01_cxx14_python3.9_osx-xcode-14.3-${DETECTED_ARCH}.tar.gz) From e8d13066dc7b04663d8705c2f795b7c70b4fd7c8 Mon Sep 17 00:00:00 2001 From: Tobias Duswald Date: Tue, 21 Nov 2023 10:58:16 +0100 Subject: [PATCH 2/2] Add links to error message --- cmake/external/ROOT.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/external/ROOT.cmake b/cmake/external/ROOT.cmake index 574d139c1..0cc486bb0 100644 --- a/cmake/external/ROOT.cmake +++ b/cmake/external/ROOT.cmake @@ -17,7 +17,10 @@ if(APPLE) if("${XCODE_ERROR}" STREQUAL "") message(STATUS "##### XCODE is installed") else() - message(FATAL_ERROR "##### XCODE is not installed correctly. Please install XCODE (and then the command line tools). Consult issue #352 and the documentation") + message(FATAL_ERROR "##### XCODE is not installed correctly. " + "Please install XCODE (and then the command line tools). " + "Consult the documentation (https://biodynamo.github.io/docs/userguide/prerequisites/#macos) " + "and issue #352 (https://github.com/BioDynaMo/biodynamo/issues/352).") endif() # Determine XCDOE version execute_process(COMMAND bash "-c" "xcodebuild -version | sed -En 's/Xcode[[:space:]]+([0-9\.]*)/\\1/p'" OUTPUT_VARIABLE XCODE_VERS)