summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-08-15 13:34:02 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-08-15 13:34:16 (GMT)
commitd1130ea704fb1ab9161c404ee34049a697bd3647 (patch)
treef63654fabf85148ce45ef09e05d72222c0a265df
parent6ba173ba35db41d1a35431ea2066a626e658eb88 (diff)
parent597139b853f2f14c71047e41a3244a397c6ee728 (diff)
downloadCMake-d1130ea704fb1ab9161c404ee34049a697bd3647.zip
CMake-d1130ea704fb1ab9161c404ee34049a697bd3647.tar.gz
CMake-d1130ea704fb1ab9161c404ee34049a697bd3647.tar.bz2
Merge topic 'FindJNI-no-xcode'
597139b853 FindJNI: Restore support for macOS without Xcode Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8707
-rw-r--r--Modules/FindJNI.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index c6d7b09..e7050a3 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -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)