From ff7f32f26b7e82c3dfde5530232433e616169061 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 22 Apr 2021 14:55:05 +0200 Subject: [PATCH] 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 --- cmake/QtAutoDetect.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake index fd62fcb406..15d0db42c4 100644 --- a/cmake/QtAutoDetect.cmake +++ b/cmake/QtAutoDetect.cmake @@ -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}")