diff options
author | Brad King <brad.king@kitware.com> | 2023-08-08 13:44:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-08-08 13:52:26 (GMT) |
commit | 75783213e399b9fa9bd6bebb3f6662c91de09c0f (patch) | |
tree | f44a4a1f87f677a7f2ff2bdbd7ad8c0b1fe3a16a | |
parent | fa8351e6371348f79c066e284483866539841d6c (diff) | |
parent | efa0e2ddafe48ef0921b31aef37c3187a7bb6b97 (diff) | |
download | CMake-75783213e399b9fa9bd6bebb3f6662c91de09c0f.zip CMake-75783213e399b9fa9bd6bebb3f6662c91de09c0f.tar.gz CMake-75783213e399b9fa9bd6bebb3f6662c91de09c0f.tar.bz2 |
Merge topic 'FindJNI-xcode-12.2'
efa0e2ddaf FindJNI: Update for Xcode greater than 12.1 on macOS
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8690
-rw-r--r-- | Modules/FindJNI.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index 27f9b0e..c6d7b09 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -383,6 +383,23 @@ foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}") endforeach() if(APPLE) + if(DEFINED XCODE_VERSION) + set(_FindJNI_XCODE_VERSION "${XCODE_VERSION}") + 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) + endif() + + if(_FindJNI_XCODE_VERSION VERSION_GREATER 12.1) + set(CMAKE_FIND_FRAMEWORK "NEVER") + endif() + unset(_FindJNI_XCODE_VERSION) + if(CMAKE_FIND_FRAMEWORK STREQUAL "ONLY") set(_JNI_SEARCHES FRAMEWORK) elseif(CMAKE_FIND_FRAMEWORK STREQUAL "NEVER") |