From af5e50edf73b98fc7b995906b8ddd492756bff52 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 8 May 2023 17:59:26 +0200 Subject: CMakePM: Cancel current build before locator "cm " In case the current project is building and the user starts a "cm " in Locator, now the build is canceled before starting a a "cmake --build --target ". Fixes: QTCREATORBUG-26699 Change-Id: I27ed9ba5b8d917dce94835a5462e4e64e7515bd9 Reviewed-by: hjk --- src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index ab646d1fa6..0eab601200 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -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(); -- cgit v1.2.1