Android: Handle Qt 5 CMake projects target build dir retrieval

This makes sure that Qt 5 CMake android projects return the build dir
and not the android build libs folder.

Change-Id: I675e2ea2946beb63bbe08b9bf4b7d9603c386f09
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2021-09-09 11:45:48 +03:00
parent 2413aac32b
commit b9add29ae0
3 changed files with 32 additions and 12 deletions

View File

@@ -43,7 +43,6 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projecttree.h>
#include <projectexplorer/buildsystem.h>
#include <cmakeprojectmanager/cmakeprojectconstants.h>
#include <proparser/profileevaluator.h>
@@ -183,18 +182,15 @@ Utils::FilePath AndroidQtVersion::androidDeploymentSettings(const Target *target
}
// If unavailable, construct the name by ourselves (CMake)
const BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit());
const bool isQt5 = qt && qt->qtVersion() < QtSupport::QtVersionNumber{6, 0, 0};
const Core::Context cmakeCtx = Core::Context(CMakeProjectManager::Constants::CMAKE_PROJECT_ID);
const bool isCmakeProject = (target->project()->projectContext() == cmakeCtx);
const BuildSystem *bs = target->buildSystem();
if (!bs)
return {};
const BuildTargetInfo buildTarget = bs->buildTarget(buildKey);
return buildTarget.workingDirectory.pathAppended((isQt5 && isCmakeProject)
? QLatin1String("android_deployment_settings.json")
: QString::fromLatin1("android-%1-deployment-settings.json")
.arg(buildTarget.displayName));
const QString displayName = bs->buildTarget(buildKey).displayName;
return AndroidManager::buildDirectory(target).pathAppended(
AndroidManager::isQt5CmakeProject(target)
? QLatin1String("android_deployment_settings.json")
: QString::fromLatin1("android-%1-deployment-settings.json")
.arg(displayName));
}
void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const