Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build OpenCV4Android with cmdline-tools #23642

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions cmake/android/OpenCVDetectAndroidSDK.cmake
Expand Up @@ -56,8 +56,13 @@ endmacro()
macro(ocv_detect_android_sdk_tools)
# https://developer.android.com/studio/releases/sdk-tools.html
if(NOT DEFINED ANDROID_SDK_TOOLS)
if(DEFINED ANDROID_SDK AND EXISTS "${ANDROID_SDK}/tools")
set(ANDROID_SDK_TOOLS "${ANDROID_SDK}/tools" CACHE INTERNAL "Android SDK Tools path")
if(DEFINED ANDROID_SDK)
if (EXISTS "${ANDROID_SDK}/cmdline-tools")
set(ANDROID_SDK_TOOLS "${ANDROID_SDK}/cmdline-tools" CACHE INTERNAL "Android SDK Tools path")
set(ANDROID_SDK_CMDLINE_TOOLS "${ANDROID_SDK_TOOLS}" CACHE INTERNAL "Android SDK Command-line Tools path")
elseif(EXISTS "${ANDROID_SDK}/tools")
set(ANDROID_SDK_TOOLS "${ANDROID_SDK}/tools" CACHE INTERNAL "Android SDK Tools path")
endif()
endif()
endif()
if(NOT DEFINED ANDROID_SDK_TOOLS)
Expand Down Expand Up @@ -173,12 +178,12 @@ if(BUILD_ANDROID_PROJECTS)
ocv_detect_android_sdk_tools()
ocv_detect_android_sdk_build_tools()

if(ANDROID_SDK_TOOLS_VERSION VERSION_LESS 14)
if(NOT DEFINED ANDROID_SDK_CMDLINE_TOOLS AND 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)
if(DEFINED ANDROID_SDK_CMDLINE_TOOLS OR 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)
Expand Down