Docker: Simple Auto-detection for cmake binaries

Change-Id: Ia7e6f648c99c87786604cb8801c1408b9e231d3d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-05-17 13:49:43 +02:00
parent df4b682474
commit 8ffeecc633
4 changed files with 50 additions and 0 deletions

View File

@@ -27,6 +27,8 @@
#include "cmaketoolsettingsaccessor.h"
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/icore.h>
@@ -69,10 +71,14 @@ CMakeToolManager::CMakeToolManager()
connect(this, &CMakeToolManager::cmakeAdded, this, &CMakeToolManager::cmakeToolsChanged);
connect(this, &CMakeToolManager::cmakeRemoved, this, &CMakeToolManager::cmakeToolsChanged);
connect(this, &CMakeToolManager::cmakeUpdated, this, &CMakeToolManager::cmakeToolsChanged);
setObjectName("CMakeToolManager");
ExtensionSystem::PluginManager::addObject(this);
}
CMakeToolManager::~CMakeToolManager()
{
ExtensionSystem::PluginManager::removeObject(this);
delete d;
}
@@ -171,6 +177,20 @@ void CMakeToolManager::updateDocumentation()
Core::HelpManager::registerDocumentation(docs);
}
void CMakeToolManager::registerCMakeByPath(const FilePath &cmakePath)
{
const Id id = Id::fromString(cmakePath.toUserOutput());
CMakeTool *cmakeTool = findById(id);
if (cmakeTool)
return;
auto newTool = std::make_unique<CMakeTool>(CMakeTool::ManualDetection, id);
newTool->setFilePath(cmakePath);
newTool->setDisplayName(cmakePath.toUserOutput());
registerCMakeTool(std::move(newTool));
}
void CMakeToolManager::notifyAboutUpdate(CMakeTool *tool)
{
if (!tool || !Utils::contains(d->m_cmakeTools, tool))