forked from qt-creator/qt-creator
CMake: Allow autodetected tools to associate themselves with kits
Change-Id: I5b48ddf36ba1b9c4eb6476017be63c4d43b60627 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -272,8 +272,19 @@ Tasks CMakeKitAspect::validate(const Kit *k) const
|
||||
void CMakeKitAspect::setup(Kit *k)
|
||||
{
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(k);
|
||||
if (!tool)
|
||||
setCMakeTool(k, defaultCMakeToolId());
|
||||
if (tool)
|
||||
return;
|
||||
|
||||
// Look for a suitable auto-detected one:
|
||||
const QString id = k->autoDetectionSource();
|
||||
for (CMakeTool *tool : CMakeToolManager::cmakeTools()) {
|
||||
if (tool->detectionSource() == id) {
|
||||
setCMakeTool(k, tool->id());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setCMakeTool(k, defaultCMakeToolId());
|
||||
}
|
||||
|
||||
void CMakeKitAspect::fix(Kit *k)
|
||||
|
||||
Reference in New Issue
Block a user