forked from qt-creator/qt-creator
CMakeProjectManager: Use buildDirectory instead of "."
When issuing cmake --build "." as an user I don't get to see which build directory is being actually built. To make things worse in project settings the build directory field is disabled and cannot be copied. Change-Id: Idf862ba1df68cde55e9785c934f67393da6c1616 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -379,7 +379,10 @@ CommandLine CMakeBuildStep::cmakeCommand() const
|
|||||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(kit());
|
CMakeTool *tool = CMakeKitAspect::cmakeTool(kit());
|
||||||
|
|
||||||
Utils::CommandLine cmd(tool ? tool->cmakeExecutable() : Utils::FilePath(), {});
|
Utils::CommandLine cmd(tool ? tool->cmakeExecutable() : Utils::FilePath(), {});
|
||||||
cmd.addArgs({"--build", "."});
|
QString buildDirectory = ".";
|
||||||
|
if (buildConfiguration())
|
||||||
|
buildDirectory = buildConfiguration()->buildDirectory().toString();
|
||||||
|
cmd.addArgs({"--build", buildDirectory});
|
||||||
|
|
||||||
cmd.addArg("--target");
|
cmd.addArg("--target");
|
||||||
cmd.addArgs(Utils::transform(m_buildTargets, [this](const QString &s) {
|
cmd.addArgs(Utils::transform(m_buildTargets, [this](const QString &s) {
|
||||||
|
@@ -134,7 +134,11 @@ MakeInstallCommand CMakeProject::makeInstallCommand(const Target *target,
|
|||||||
config << "--config" << bc->cmakeBuildType();
|
config << "--config" << bc->cmakeBuildType();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.arguments << "--build" << "." << "--target" << installTarget << config;
|
QString buildDirectory = ".";
|
||||||
|
if (bc)
|
||||||
|
buildDirectory = bc->buildDirectory().toString();
|
||||||
|
|
||||||
|
cmd.arguments << "--build" << buildDirectory << "--target" << installTarget << config;
|
||||||
|
|
||||||
cmd.environment.set("DESTDIR", QDir::toNativeSeparators(installRoot));
|
cmd.environment.set("DESTDIR", QDir::toNativeSeparators(installRoot));
|
||||||
return cmd;
|
return cmd;
|
||||||
|
Reference in New Issue
Block a user