CMake: Fix default cmake tool

If Boot2Qt devices are registered, their CMake tool would often end up
as the default. Instead now we only auto select a cmake tool on the
local machine.

Change-Id: I677ab06ae88ff36209e691ea0fadb356436e973c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-10-10 09:45:10 +02:00
parent c9cf86856c
commit f1c3482e0d

View File

@@ -426,8 +426,9 @@ void CMakeToolManager::ensureDefaultCMakeToolIsValid()
} else {
if (findById(d->m_defaultCMake))
return;
auto cmakeTool = Utils::findOrDefault(
cmakeTools(), [](CMakeTool *tool){ return tool->detectionSource().isEmpty(); });
auto cmakeTool = Utils::findOrDefault(cmakeTools(), [](CMakeTool *tool) {
return tool->detectionSource().isEmpty() && !tool->cmakeExecutable().needsDevice();
});
if (cmakeTool)
d->m_defaultCMake = cmakeTool->id();
}