From 62c33f909df6c6ddcc96caae202b3aceb3388add Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 7 Sep 2021 12:51:02 +0300 Subject: [PATCH] CMake: Don't build apk by default with CMake's ALL target From Qt 6.1, Qt 6.1 builds the apk directly with ALL step if it's not a Qt build. Change-Id: Ib8573399a1ed509852a973e84405353191e80f86 Reviewed-by: Cristian Adam Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 8e064aaf989..c34e064adca 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -948,6 +948,9 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) auto sdkLocation = bs->data(Android::Constants::SdkLocation).value(); if (qt && qt->qtVersion() >= QtSupport::QtVersionNumber{6, 0, 0}) { + // Don't build apk under ALL target because Qt Creator will handle it + if (qt->qtVersion() >= QtSupport::QtVersionNumber{6, 1, 0}) + initialArgs.append("-DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL:BOOL=ON"); initialArgs.append("-DQT_HOST_PATH:PATH=%{Qt:QT_HOST_PREFIX}"); initialArgs.append("-DANDROID_SDK_ROOT:PATH=" + sdkLocation.path()); } else {