From 1cc50c8dcc930249953e0e8bef172215deecfd2f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 9 Dec 2021 13:08:25 +0100 Subject: [PATCH] CMakePM: Prevent device cmake becoming default When auto-detecting cmake on device ensure any found cmake will not end up as default cmake as this would update even desktop related kits to use this if they had no cmake configured before. Change-Id: I27960fc1f76d95bd7ddef6bff40f163aa46a610d Reviewed-by: Reviewed-by: Cristian Adam --- src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 6af8a6a9c62..b96f0fa674a 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -261,7 +261,10 @@ void CMakeToolManager::ensureDefaultCMakeToolIsValid() } else { if (findById(d->m_defaultCMake)) return; - d->m_defaultCMake = d->m_cmakeTools.at(0)->id(); + auto cmakeTool = Utils::findOrDefault( + cmakeTools(), [](CMakeTool *tool){ return tool->detectionSource().isEmpty(); }); + if (cmakeTool) + d->m_defaultCMake = cmakeTool->id(); } // signaling: