ProjectExplorer: Move makeInstallCommand()

... from Project to BuildSystem.

More direct and less use of Target::activeBuildConfiguration().

Change-Id: I148381d23be0f9ab0750ed1440e1b2b3e25aded0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-06-10 16:41:27 +02:00
parent 9a411245d3
commit f974488128
15 changed files with 70 additions and 82 deletions

View File

@@ -32,11 +32,9 @@
#include "editorconfiguration.h"
#include "kit.h"
#include "kitinformation.h"
#include "makestep.h"
#include "projectexplorer.h"
#include "projectnodes.h"
#include "runconfiguration.h"
#include "runcontrol.h"
#include "session.h"
#include "target.h"
#include "taskhub.h"
@@ -971,19 +969,6 @@ bool Project::hasMakeInstallEquivalent() const
return d->m_hasMakeInstallEquivalent;
}
MakeInstallCommand Project::makeInstallCommand(const Target *target, const FilePath &installRoot)
{
QTC_ASSERT(hasMakeInstallEquivalent(), return MakeInstallCommand());
MakeInstallCommand cmd;
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
if (const auto makeStep = bc->buildSteps()->firstOfType<MakeStep>())
cmd.command.setExecutable(makeStep->makeExecutable());
}
cmd.command.addArg("install");
cmd.command.addArg("INSTALL_ROOT=" + installRoot.nativePath());
return cmd;
}
void Project::setup(const QList<BuildInfo> &infoList)
{
std::vector<std::unique_ptr<Target>> toRegister;