Android: Do not auto-detect NDK if ANDROID_NDK_ROOT is set

When ANDROID_NDK_ROOT is explicitly set by the user, there's no point in
detecting the NDK. The detection had no effect, because the already set
ANDROID_NDK_ROOT variable would not be overwritten by our set call.

Fix the condition of the check: There is no CMAKE_ANDROID_NDK_ROOT
variable.

Pick-to: 6.1
Change-Id: I8f0d4f2a1a67445f67a79c7d2d0932099828b05e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
Joerg Bornemann 2021-04-22 14:55:05 +02:00
parent 393f45de90
commit ff7f32f26b
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ endfunction()
function(qt_auto_detect_android)
# Auto-detect NDK root
if(NOT DEFINED CMAKE_ANDROID_NDK_ROOT AND DEFINED ANDROID_SDK_ROOT)
if(NOT DEFINED ANDROID_NDK_ROOT AND DEFINED ANDROID_SDK_ROOT)
set(ndk_root "${ANDROID_SDK_ROOT}/ndk-bundle")
if(IS_DIRECTORY "${ndk_root}")
message(STATUS "Android NDK detected: ${ndk_root}")