QbsPM: Fix look-up of executable on Desktop

... if installation at build time is disabled and a dedicated install
step exists.

Fixes: QTCREATORBUG-23039
Change-Id: I7115368bb1993ebdb48200d2a9c55c34a7bdceec
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Christian Kandeler
2019-10-10 17:19:09 +02:00
parent 4b76f6c65d
commit e0ebda45db

View File

@@ -27,6 +27,7 @@
#include "qbsbuildconfiguration.h" #include "qbsbuildconfiguration.h"
#include "qbsbuildstep.h" #include "qbsbuildstep.h"
#include "qbsinstallstep.h"
#include "qbslogsink.h" #include "qbslogsink.h"
#include "qbspmlogging.h" #include "qbspmlogging.h"
#include "qbsprojectimporter.h" #include "qbsprojectimporter.h"
@@ -50,6 +51,7 @@
#include <projectexplorer/buildinfo.h> #include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildmanager.h> #include <projectexplorer/buildmanager.h>
#include <projectexplorer/buildtargetinfo.h> #include <projectexplorer/buildtargetinfo.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/deploymentdata.h> #include <projectexplorer/deploymentdata.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
@@ -488,6 +490,14 @@ FilePath QbsProject::installRoot()
{ {
if (!activeTarget()) if (!activeTarget())
return FilePath(); return FilePath();
const auto dc = activeTarget()->activeDeployConfiguration();
if (dc) {
const QList<QbsInstallStep *> qbsInstallSteps = dc->stepList()->allOfType<QbsInstallStep>();
for (QbsInstallStep * const step : qbsInstallSteps) {
if (step->enabled())
return FilePath::fromString(step->installRoot());
}
}
const auto * const bc const auto * const bc
= qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration()); = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
if (!bc) if (!bc)