summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager/cmakeproject.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-06-10 16:41:27 +0200
committerhjk <hjk@qt.io>2022-06-13 10:22:40 +0000
commitf97448812860c682e5e7cf716478c8ee24a577be (patch)
treea36b7d6458d4ec7dfec5622a66984712433603d8 /src/plugins/cmakeprojectmanager/cmakeproject.cpp
parent9a411245d3f35c232be0affe4137e7a922101b8f (diff)
downloadqt-creator-f97448812860c682e5e7cf716478c8ee24a577be.tar.gz
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>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakeproject.cpp')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index 445e9b1ab3..ee6696b0e6 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -116,40 +116,4 @@ ProjectExplorer::DeploymentKnowledge CMakeProject::deploymentKnowledge() const
: DeploymentKnowledge::Bad;
}
-MakeInstallCommand CMakeProject::makeInstallCommand(const Target *target,
- const FilePath &installRoot)
-{
- MakeInstallCommand cmd;
- if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
- if (const auto cmakeStep = bc->buildSteps()->firstOfType<CMakeBuildStep>()) {
- if (CMakeTool *tool = CMakeKitAspect::cmakeTool(target->kit()))
- cmd.command.setExecutable(tool->cmakeExecutable());
- }
- }
-
- QString installTarget = "install";
- QStringList config;
-
- auto bs = qobject_cast<CMakeBuildSystem*>(target->buildSystem());
- QTC_ASSERT(bs, return {});
-
- if (bs->usesAllCapsTargets())
- installTarget = "INSTALL";
- if (bs->isMultiConfigReader())
- config << "--config" << bs->cmakeBuildType();
-
- FilePath buildDirectory = ".";
- if (auto bc = bs->buildConfiguration())
- buildDirectory = bc->buildDirectory();
-
- cmd.command.addArg("--build");
- cmd.command.addArg(buildDirectory.onDevice(cmd.command.executable()).path());
- cmd.command.addArg("--target");
- cmd.command.addArg(installTarget);
- cmd.command.addArgs(config);
-
- cmd.environment.set("DESTDIR", installRoot.nativePath());
- return cmd;
-}
-
} // namespace CMakeProjectManager