CMake: Fix target names for "current executable" selection

This patch is not applicable to the master-branch: The buildkeys
for cmake targets have changed there.

Task-number: QTCREATORBUG-22634
Change-Id: I1c8abc42792a004bdadc893129c96e1b7ed428f6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2019-07-29 13:51:43 +02:00
parent 2a15098c98
commit f9659211ac

View File

@@ -349,10 +349,15 @@ Utils::CommandLine CMakeBuildStep::cmakeCommand(CMakeRunConfiguration *rc) const
QString target; QString target;
if (isCurrentExecutableTarget(m_buildTarget)) { if (isCurrentExecutableTarget(m_buildTarget)) {
if (rc) if (rc) {
target = rc->buildKey().section('\n', 0, 0); target = rc->buildKey();
else const int pos = target.indexOf("///::///");
if (pos >= 0) {
target = target.mid(pos + 8);
}
} else {
target = "<i>&lt;" + tr(ADD_RUNCONFIGURATION_TEXT) + "&gt;</i>"; target = "<i>&lt;" + tr(ADD_RUNCONFIGURATION_TEXT) + "&gt;</i>";
}
} else { } else {
target = m_buildTarget; target = m_buildTarget;
} }