CMakePM: Cancel current build before locator "cm <target>"

In case the current project is building and the user starts a "cm
<target>" in Locator, now the build is canceled before starting a a
"cmake --build --target <target>".

Fixes: QTCREATORBUG-26699
Change-Id: I27ed9ba5b8d917dce94835a5462e4e64e7515bd9
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Cristian Adam
2023-05-08 17:59:26 +02:00
parent 430f07cf38
commit af5e50edf7

View File

@@ -122,6 +122,9 @@ void BuildCMakeTargetLocatorFilter::accept(const Core::LocatorFilterEntry &selec
|| !cmakeProject->activeTarget()->activeBuildConfiguration())
return;
if (BuildManager::isBuilding(cmakeProject))
BuildManager::cancel();
// Find the make step
BuildStepList *buildStepList =
cmakeProject->activeTarget()->activeBuildConfiguration()->buildSteps();