From a2af3e11e18488f8c70c31d88bc5966e679a6ae0 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 10 Jun 2024 13:41:00 +0200 Subject: [PATCH] Make the access to QT_USE_TARGET_ANDROID_BUILD_DIR explicit CMake somehow doesn't treat the access to the cache variable in condition as the usage. Replace the check of the CACHE{QT_USE_TARGET_ANDROID_BUILD_DIR} value with the check of the CACHE variable definition and the check of the CACHE and non-CACHE value equality. Pick-to: 6.7 Change-Id: I07d940d457ebbc4ce3cefef2f73394009d52f367 Reviewed-by: Alexandru Croitor (cherry picked from commit 69a661e88e6a7799799033030497086a9194caab) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/Qt6AndroidMacros.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index a78a5a1af6d..40620ee5b13 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -404,7 +404,8 @@ function(qt6_android_add_apk_target target) # No need to use genex for the BINARY_DIR since it's read-only. get_target_property(target_binary_dir ${target} BINARY_DIR) - if($CACHE{QT_USE_TARGET_ANDROID_BUILD_DIR}) + if("$CACHE{QT_USE_TARGET_ANDROID_BUILD_DIR}" AND + "$CACHE{QT_USE_TARGET_ANDROID_BUILD_DIR}" STREQUAL "${QT_USE_TARGET_ANDROID_BUILD_DIR}") set(apk_final_dir "${target_binary_dir}/android-build-${target}") else() if(QT_USE_TARGET_ANDROID_BUILD_DIR)