Filter the Android SDK build tools directories

Avoid using non-version like directories from the android build-tools
directory.

Fixes: QTBUG-94956
Pick-to: 6.8 6.7 6.5 6.2
Change-Id: Ib201c43db2c5ee4a67bea90027ae5363a8d06709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Alexey Edelev 2024-08-22 12:23:00 +02:00
parent a0a0828566
commit 58542f9c36

View File

@ -10,7 +10,8 @@ function(_qt_internal_android_get_sdk_build_tools_revision out_var)
LIST_DIRECTORIES true
RELATIVE "${ANDROID_SDK_ROOT}/build-tools"
"${ANDROID_SDK_ROOT}/build-tools/*")
if (NOT android_build_tools)
list(FILTER android_build_tools INCLUDE REGEX "[0-9]+\.[0-9]+(\.[0-9]+)?")
if(NOT android_build_tools)
message(FATAL_ERROR "Could not locate Android SDK build tools under \"${ANDROID_SDK_ROOT}/build-tools\"")
endif()
list(SORT android_build_tools)