diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-07-29 13:51:43 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-07-29 12:15:57 +0000 |
commit | f9659211ac4dffacc62437ef5363300e42f243c2 (patch) | |
tree | 835197180ae65a34f35dc0b9735bad2273e6010b /src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | |
parent | 2a15098c98aa43a59e8ca3a79e4ee37004e58e57 (diff) |
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>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakebuildstep.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 364337308ba..911ac7ae2f0 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -349,10 +349,15 @@ Utils::CommandLine CMakeBuildStep::cmakeCommand(CMakeRunConfiguration *rc) const QString target; if (isCurrentExecutableTarget(m_buildTarget)) { - if (rc) - target = rc->buildKey().section('\n', 0, 0); - else + if (rc) { + target = rc->buildKey(); + const int pos = target.indexOf("///::///"); + if (pos >= 0) { + target = target.mid(pos + 8); + } + } else { target = "<i><" + tr(ADD_RUNCONFIGURATION_TEXT) + "></i>"; + } } else { target = m_buildTarget; } |