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.7 6.5 6.2
Change-Id: Ib201c43db2c5ee4a67bea90027ae5363a8d06709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 58542f9c367efe5198172dfc7aaabf1e8c2c90bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2024-08-22 12:23:00 +02:00 committed by Qt Cherry-pick Bot
parent 456037a4d3
commit 8f09ff24c2

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)