mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
FindJNI: Restore support for macOS without Xcode
Fix logic added by commit efa0e2ddaf (FindJNI: Update for Xcode greater than
12.1 on macOS, 2023-08-06, v3.27.2~5^2) to tolerate missing `xcodebuild`.
Fixes: #25181
This commit is contained in:
@@ -388,11 +388,15 @@ if(APPLE)
|
||||
else()
|
||||
# get xcode version
|
||||
execute_process(
|
||||
COMMAND xcodebuild -version
|
||||
OUTPUT_VARIABLE _xcode_version
|
||||
)
|
||||
string(REGEX REPLACE "Xcode ([0-9]+(\\.[0-9]+)*)" "\\1" _FindJNI_XCODE_VERSION ${_xcode_version})
|
||||
unset(_xcode_version)
|
||||
COMMAND xcodebuild -version
|
||||
OUTPUT_VARIABLE _FindJNI_XCODEBUILD_VERSION
|
||||
)
|
||||
if(_FindJNI_XCODEBUILD_VERSION MATCHES "Xcode ([0-9]+(\\.[0-9]+)*)")
|
||||
set(_FindJNI_XCODE_VERSION "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(_FindJNI_XCODE_VERSION "")
|
||||
endif()
|
||||
unset(_FindJNI_XCODEBUILD_VERSION)
|
||||
endif()
|
||||
|
||||
if(_FindJNI_XCODE_VERSION VERSION_GREATER 12.1)
|
||||
|
||||
Reference in New Issue
Block a user