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: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Christian Stenger
2021-12-09 13:08:25 +01:00
parent 03a0e6211d
commit 1cc50c8dcc

View File

@@ -261,7 +261,10 @@ void CMakeToolManager::ensureDefaultCMakeToolIsValid()
} else { } else {
if (findById(d->m_defaultCMake)) if (findById(d->m_defaultCMake))
return; 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: // signaling: