diff options
author | Brad King <brad.king@kitware.com> | 2024-08-19 15:30:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-08-19 15:37:48 (GMT) |
commit | 7402593a08aaa0cedacad8390bd0082c7137d706 (patch) | |
tree | c7b831fa82cd03e36bca26a33b04fca171afd717 | |
parent | 97bb92ace5fa26e20a0d0f87131dce9567048985 (diff) | |
download | CMake-7402593a08aaa0cedacad8390bd0082c7137d706.zip CMake-7402593a08aaa0cedacad8390bd0082c7137d706.tar.gz CMake-7402593a08aaa0cedacad8390bd0082c7137d706.tar.bz2 |
FindJNI: Improve output on macOS if Xcode is not installed
Improve the changes from:
* commit efa0e2ddaf (FindJNI: Update for Xcode greater than 12.1 on macOS,
2023-08-06, v3.27.2~5^2)
* commit 597139b853 (FindJNI: Restore support for macOS without Xcode,
2023-08-11, v3.27.3~8^2)
to avoid leaking `xcodebuild`'s stderr.
Issue: #26229
-rw-r--r-- | Modules/FindJNI.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index 51f05b9..82e3d88 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -391,8 +391,10 @@ if(APPLE) execute_process( COMMAND xcodebuild -version OUTPUT_VARIABLE _FindJNI_XCODEBUILD_VERSION + ERROR_VARIABLE _FindJNI_XCODEBUILD_VERSION + RESULT_VARIABLE _FindJNI_XCODEBUILD_RESULT ) - if(_FindJNI_XCODEBUILD_VERSION MATCHES "Xcode ([0-9]+(\\.[0-9]+)*)") + if(_FindJNI_XCODEBUILD_RESULT EQUAL 0 AND _FindJNI_XCODEBUILD_VERSION MATCHES "Xcode ([0-9]+(\\.[0-9]+)*)") set(_FindJNI_XCODE_VERSION "${CMAKE_MATCH_1}") else() set(_FindJNI_XCODE_VERSION "") |