Commit a3be2c08 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

CMake: Fix clean target

Always list a "all" and "clean" targets and remove the similar code
in the tealeaf reader.

This fixes the clean-step falling back to "all" in server-mode.

Task-number: QTCREATORBUG-17138
Change-Id: I1ce84f03c2e9829e4bb5f550c10cdef772fabf5b
Reviewed-by: Tim Jenssen's avatarTim Jenssen <>
parent 5605337f
...@@ -444,19 +444,26 @@ QString CMakeBuildStepConfigWidget::displayName() const ...@@ -444,19 +444,26 @@ QString CMakeBuildStepConfigWidget::displayName() const
return tr("Build", "CMakeProjectManager::CMakeBuildStepConfigWidget display name."); return tr("Build", "CMakeProjectManager::CMakeBuildStepConfigWidget display name.");
} }
void CMakeBuildStepConfigWidget::buildTargetsChanged() static void createSpecialItem(const QString &text, const QString &data, QListWidget *parent)
{ {
const bool wasBlocked = m_buildTargetsList->blockSignals(true); auto item = new QListWidgetItem(text, parent);
auto item = new QListWidgetItem(tr(ADD_RUNCONFIGURATION_TEXT), m_buildTargetsList); item->setData(Qt::UserRole, data);
item->setData(Qt::UserRole, QString::fromLatin1(ADD_RUNCONFIGURATION_TEXT));
QFont f; QFont f;
f.setItalic(true); f.setItalic(true);
item->setFont(f); item->setFont(f);
void CMakeBuildStepConfigWidget::buildTargetsChanged()
const bool wasBlocked = m_buildTargetsList->blockSignals(true);
createSpecialItem(tr("all"), "all", m_buildTargetsList);
createSpecialItem(tr("clean"), "clean", m_buildTargetsList);
CMakeProject *pro = static_cast<CMakeProject *>(m_buildStep->project()); auto pro = static_cast<CMakeProject *>(m_buildStep->project());
QStringList targetList = pro->buildTargetTitles(); QStringList targetList = pro->buildTargetTitles();
targetList.sort(); targetList.sort();
...@@ -180,15 +180,6 @@ bool CMakeCbpParser::parseCbpFile(CMakeTool::PathMapper mapper, const FileName & ...@@ -180,15 +180,6 @@ bool CMakeCbpParser::parseCbpFile(CMakeTool::PathMapper mapper, const FileName &
fi.close(); fi.close();
// There is always a clean target:
CMakeBuildTarget cleanTarget;
cleanTarget.title = "clean";
cleanTarget.targetType = UtilityType;
cleanTarget.workingDirectory = m_buildDirectory;
cleanTarget.sourceDirectory = m_sourceDirectory;
return true; return true;
} }
return false; return false;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment