CMake: Use RCs buildSystemTarget when deciding what to build

Use the RCs buildSystemTarget property when deciding what to build
with the "build current executable only" property set. This makes
the selection more robust.

Change-Id: I0dbcd764a06428b441084e6e4dc680e106c6d3bd
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2017-04-24 13:25:01 +02:00
parent cad16c4bee
commit 79f5a27568

View File

@@ -185,7 +185,7 @@ bool CMakeBuildStep::init(QList<const BuildStep *> &earlierSteps)
}
CMakeRunConfiguration *rc = targetsActiveRunConfiguration();
if (isCurrentExecutableTarget(m_buildTarget) && (!rc || rc->title().isEmpty())) {
if (isCurrentExecutableTarget(m_buildTarget) && (!rc || rc->buildSystemTarget().isEmpty())) {
emit addTask(Task(Task::Error,
QCoreApplication::translate("ProjectExplorer::Task",
"You asked to build the current Run Configuration's build target only, "
@@ -348,7 +348,7 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const
if (isCurrentExecutableTarget(m_buildTarget)) {
if (rc)
target = rc->title();
target = rc->buildSystemTarget();
else
target = QLatin1String("<i>&lt;") + tr(ADD_RUNCONFIGURATION_TEXT) + QLatin1String("&gt;</i>");
} else {