CMake: Only allow one target in cmake build step

CMake will silently ignore all but the last target (or fail to build
anything). This allows to simplify our code.

Change-Id: Ieee3931aca0788307107e2021d507073ef42a21f
Task-number: QTCREATORBUG-15928
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-03-30 13:06:21 +02:00
parent 414d41ab3c
commit 2c822ae3c1
4 changed files with 85 additions and 106 deletions

View File

@@ -409,14 +409,14 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
auto cleanStep = new CMakeBuildStep(cleanSteps);
cleanSteps->insertStep(0, cleanStep);
cleanStep->setBuildTarget(CMakeBuildStep::cleanTarget(), true);
cleanStep->setBuildTarget(CMakeBuildStep::cleanTarget());
bc->setBuildDirectory(copy.buildDirectory);
bc->setCMakeConfiguration(copy.configuration);
// Default to all
if (project->hasBuildTarget(QLatin1String("all")))
buildStep->setBuildTarget(QLatin1String("all"), true);
if (project->hasBuildTarget(CMakeBuildStep::allTarget()))
buildStep->setBuildTarget(CMakeBuildStep::allTarget());
return bc;
}