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 <alexandru.croitor@qt.io>
(cherry picked from commit 69a661e88e6a7799799033030497086a9194caab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2024-06-10 13:41:00 +02:00 committed by Qt Cherry-pick Bot
parent f15e6d60e1
commit a2af3e11e1

View File

@ -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)