Merge pull request #21736 from anders-nylander:fix_android_sdk_tools_dependency

Android: don't require deprecated tools #21736

Checking for these deprecated is no longer necessary, and infact broken on fresh Android SDK installs. Remove the check.

resolves #21735

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
anders-nylander 2023-05-25 17:29:14 +02:00 committed by GitHub
parent 4823285b55
commit 87331ca1a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,27 +170,29 @@ endmacro() # ocv_detect_android_sdk_build_tools
if(BUILD_ANDROID_PROJECTS)
ocv_detect_android_sdk()
ocv_detect_android_sdk_tools()
ocv_detect_android_sdk_build_tools()
if(ANDROID_SDK_TOOLS_VERSION VERSION_LESS 14)
message(FATAL_ERROR "Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer.\n"
"${__msg_BUILD_ANDROID_PROJECTS}")
endif()
if(NOT ANDROID_SDK_TOOLS_VERSION VERSION_LESS 25.3.0)
message(STATUS "Android SDK Tools: Ant (Eclipse) builds are NOT supported by Android SDK")
ocv_update(ANDROID_PROJECTS_SUPPORT_ANT OFF)
if(NOT ANDROID_SDK_BUILD_TOOLS_VERSION VERSION_LESS 26.0.2)
# https://developer.android.com/studio/releases/gradle-plugin.html
message(STATUS "Android SDK Build Tools: Gradle 3.0.0+ builds support is available")
ocv_update(ANDROID_PROJECTS_SUPPORT_GRADLE ON)
endif()
if(NOT ANDROID_SDK_BUILD_TOOLS_VERSION VERSION_LESS 26.0.2)
# https://developer.android.com/studio/releases/gradle-plugin.html
message(STATUS "Android SDK Build Tools: Gradle 3.0.0+ builds support is available")
ocv_update(ANDROID_PROJECTS_SUPPORT_GRADLE ON)
else()
include(${CMAKE_CURRENT_LIST_DIR}/../OpenCVDetectApacheAnt.cmake)
if(ANT_EXECUTABLE AND NOT ANT_VERSION VERSION_LESS 1.7)
message(STATUS "Android SDK Tools: Ant (Eclipse) builds are supported")
ocv_update(ANDROID_PROJECTS_SUPPORT_ANT ON)
ocv_detect_android_sdk_tools()
if(ANDROID_SDK_TOOLS_VERSION VERSION_LESS 14)
message(FATAL_ERROR "Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer.\n"
"${__msg_BUILD_ANDROID_PROJECTS}")
endif()
if(NOT ANDROID_SDK_TOOLS_VERSION VERSION_LESS 25.3.0)
message(STATUS "Android SDK Tools: Ant (Eclipse) builds are NOT supported by Android SDK")
ocv_update(ANDROID_PROJECTS_SUPPORT_ANT OFF)
else()
include(${CMAKE_CURRENT_LIST_DIR}/../OpenCVDetectApacheAnt.cmake)
if(ANT_EXECUTABLE AND NOT ANT_VERSION VERSION_LESS 1.7)
message(STATUS "Android SDK Tools: Ant (Eclipse) builds are supported")
ocv_update(ANDROID_PROJECTS_SUPPORT_ANT ON)
endif()
endif()
endif()