2022-04-06 10:15:29 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2022 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "kitdetector.h"
|
2022-04-07 09:01:21 +02:00
|
|
|
|
2022-04-07 14:04:20 +02:00
|
|
|
#include <cmakeprojectmanager/cmakeprojectconstants.h>
|
|
|
|
|
|
2022-04-06 10:15:29 +02:00
|
|
|
#include <extensionsystem/pluginmanager.h>
|
|
|
|
|
|
2022-04-12 21:01:45 +02:00
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2022-04-06 10:15:29 +02:00
|
|
|
#include <projectexplorer/toolchain.h>
|
|
|
|
|
#include <projectexplorer/toolchainmanager.h>
|
|
|
|
|
|
|
|
|
|
#include <qtsupport/baseqtversion.h>
|
|
|
|
|
#include <qtsupport/qtkitinformation.h>
|
|
|
|
|
#include <qtsupport/qtversionfactory.h>
|
|
|
|
|
#include <qtsupport/qtversionmanager.h>
|
|
|
|
|
|
|
|
|
|
#include <utils/filepath.h>
|
|
|
|
|
#include <utils/qtcassert.h>
|
2022-04-07 14:04:20 +02:00
|
|
|
#include <utils/algorithm.h>
|
2022-04-06 10:15:29 +02:00
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace QtSupport;
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
|
|
|
|
namespace Docker {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class KitDetectorPrivate
|
|
|
|
|
{
|
|
|
|
|
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::KitItemDetector)
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
KitDetectorPrivate(KitDetector *parent, const IDevice::ConstPtr &device)
|
2022-04-07 09:01:21 +02:00
|
|
|
: q(parent)
|
|
|
|
|
, m_device(device)
|
2022-04-06 10:15:29 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
void autoDetect();
|
|
|
|
|
void undoAutoDetect() const;
|
|
|
|
|
void listAutoDetected() const;
|
|
|
|
|
|
|
|
|
|
void setSharedId(const QString &sharedId) { m_sharedId = sharedId; }
|
|
|
|
|
void setSearchPaths(const FilePaths &searchPaths) { m_searchPaths = searchPaths; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QtVersions autoDetectQtVersions() const;
|
|
|
|
|
QList<ToolChain *> autoDetectToolChains();
|
2022-04-07 14:04:20 +02:00
|
|
|
QList<Id> autoDetectCMake();
|
2022-04-06 10:15:29 +02:00
|
|
|
void autoDetectDebugger();
|
|
|
|
|
|
|
|
|
|
KitDetector *q;
|
|
|
|
|
IDevice::ConstPtr m_device;
|
|
|
|
|
QString m_sharedId;
|
|
|
|
|
FilePaths m_searchPaths;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
KitDetector::KitDetector(const IDevice::ConstPtr &device)
|
|
|
|
|
: d(new KitDetectorPrivate(this, device))
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
KitDetector::~KitDetector()
|
|
|
|
|
{
|
|
|
|
|
delete d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetector::autoDetect(const QString &sharedId, const FilePaths &searchPaths) const
|
|
|
|
|
{
|
|
|
|
|
d->setSharedId(sharedId);
|
|
|
|
|
d->setSearchPaths(searchPaths);
|
|
|
|
|
d->autoDetect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetector::undoAutoDetect(const QString &sharedId) const
|
|
|
|
|
{
|
|
|
|
|
d->setSharedId(sharedId);
|
|
|
|
|
d->undoAutoDetect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetector::listAutoDetected(const QString &sharedId) const
|
|
|
|
|
{
|
|
|
|
|
d->setSharedId(sharedId);
|
|
|
|
|
d->listAutoDetected();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetectorPrivate::undoAutoDetect() const
|
|
|
|
|
{
|
|
|
|
|
emit q->logOutput(tr("Start removing auto-detected items associated with this docker image."));
|
|
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Removing kits..."));
|
|
|
|
|
for (Kit *kit : KitManager::kits()) {
|
|
|
|
|
if (kit->autoDetectionSource() == m_sharedId) {
|
|
|
|
|
emit q->logOutput(tr("Removed \"%1\"").arg(kit->displayName()));
|
|
|
|
|
KitManager::deregisterKit(kit);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Removing Qt version entries..."));
|
|
|
|
|
for (QtVersion *qtVersion : QtVersionManager::versions()) {
|
|
|
|
|
if (qtVersion->detectionSource() == m_sharedId) {
|
|
|
|
|
emit q->logOutput(tr("Removed \"%1\"").arg(qtVersion->displayName()));
|
|
|
|
|
QtVersionManager::removeVersion(qtVersion);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Removing toolchain entries..."));
|
|
|
|
|
const Toolchains toolchains = ToolChainManager::toolchains();
|
|
|
|
|
for (ToolChain *toolChain : toolchains) {
|
|
|
|
|
if (toolChain && toolChain->detectionSource() == m_sharedId) {
|
|
|
|
|
emit q->logOutput(tr("Removed \"%1\"").arg(toolChain->displayName()));
|
|
|
|
|
ToolChainManager::deregisterToolChain(toolChain);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2022-04-07 09:01:21 +02:00
|
|
|
if (auto cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager")) {
|
2022-04-06 10:15:29 +02:00
|
|
|
QString logMessage;
|
|
|
|
|
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
|
|
|
|
"removeDetectedCMake",
|
|
|
|
|
Q_ARG(QString, m_sharedId),
|
|
|
|
|
Q_ARG(QString *, &logMessage));
|
|
|
|
|
QTC_CHECK(res);
|
|
|
|
|
emit q->logOutput('\n' + logMessage);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 09:01:21 +02:00
|
|
|
if (auto debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin")) {
|
2022-04-06 10:15:29 +02:00
|
|
|
QString logMessage;
|
|
|
|
|
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
|
|
|
|
"removeDetectedDebuggers",
|
|
|
|
|
Q_ARG(QString, m_sharedId),
|
|
|
|
|
Q_ARG(QString *, &logMessage));
|
|
|
|
|
QTC_CHECK(res);
|
|
|
|
|
emit q->logOutput('\n' + logMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Removal of previously auto-detected kit items finished.") + "\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetectorPrivate::listAutoDetected() const
|
|
|
|
|
{
|
|
|
|
|
emit q->logOutput(tr("Start listing auto-detected items associated with this docker image."));
|
|
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Kits:"));
|
|
|
|
|
for (Kit *kit : KitManager::kits()) {
|
|
|
|
|
if (kit->autoDetectionSource() == m_sharedId)
|
|
|
|
|
emit q->logOutput(kit->displayName());
|
2022-04-07 09:01:21 +02:00
|
|
|
}
|
2022-04-06 10:15:29 +02:00
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Qt versions:"));
|
|
|
|
|
for (QtVersion *qtVersion : QtVersionManager::versions()) {
|
|
|
|
|
if (qtVersion->detectionSource() == m_sharedId)
|
|
|
|
|
emit q->logOutput(qtVersion->displayName());
|
2022-04-07 09:01:21 +02:00
|
|
|
}
|
2022-04-06 10:15:29 +02:00
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Toolchains:"));
|
|
|
|
|
for (ToolChain *toolChain : ToolChainManager::toolchains()) {
|
|
|
|
|
if (toolChain->detectionSource() == m_sharedId)
|
|
|
|
|
emit q->logOutput(toolChain->displayName());
|
2022-04-07 09:01:21 +02:00
|
|
|
}
|
2022-04-06 10:15:29 +02:00
|
|
|
|
2022-04-07 09:01:21 +02:00
|
|
|
if (QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName(
|
|
|
|
|
"CMakeToolManager")) {
|
2022-04-06 10:15:29 +02:00
|
|
|
QString logMessage;
|
|
|
|
|
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
|
|
|
|
"listDetectedCMake",
|
|
|
|
|
Q_ARG(QString, m_sharedId),
|
|
|
|
|
Q_ARG(QString *, &logMessage));
|
|
|
|
|
QTC_CHECK(res);
|
|
|
|
|
emit q->logOutput('\n' + logMessage);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 09:01:21 +02:00
|
|
|
if (QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName(
|
|
|
|
|
"DebuggerPlugin")) {
|
2022-04-06 10:15:29 +02:00
|
|
|
QString logMessage;
|
|
|
|
|
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
|
|
|
|
"listDetectedDebuggers",
|
|
|
|
|
Q_ARG(QString, m_sharedId),
|
|
|
|
|
Q_ARG(QString *, &logMessage));
|
|
|
|
|
QTC_CHECK(res);
|
|
|
|
|
emit q->logOutput('\n' + logMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emit q->logOutput('\n' + tr("Listing of previously auto-detected kit items finished.") + "\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtVersions KitDetectorPrivate::autoDetectQtVersions() const
|
|
|
|
|
{
|
|
|
|
|
QtVersions qtVersions;
|
|
|
|
|
|
|
|
|
|
QString error;
|
|
|
|
|
|
|
|
|
|
const auto handleQmake = [this, &qtVersions, &error](const FilePath &qmake) {
|
QtSupport: Add support to register Qt versions via qtpaths
qmake is a "build tool", and it is also a "query tool" when called with
parameter "-query". Qt Creator, so far, assumes that building and
querying with a Qt installation are done with one and the same tool:
qmake. This change adds the ability to register a Qt version vie either
qmake or qtpaths and still build with qmake, if that is installed (which
is not anymore mandatory from Qt 6 on).
1) Distinguish between Qt query tool and qmake build tool:
Add QtVersion::queryToolFilePath() to the existing
QtVersion::qmakeFilePath(), and use queryToolFilePath in most "query"
related code, and qmakeFilePath when building with qmake (e.g. in
QmakeProjectManager).
Also, a couple of functions and variables were renamed from *qmake* to
*queryTool* in order to express that the affected code is about
querying/managing Qt versions rather than about building with qmake.
2) Support manual Qt Version adding by qtpaths via file dialog
This change adds qtpaths to the "Add" Qt Version file picker filter.
After selection, "qtpaths -query" is executed for testing purposes. If
that fails, (e.g. because it is an older Qt version), qmake is instead
chosen, silently.
Task-number: QTCREATORBUG-22175
Task-number: QTCREATORBUG-25546
Change-Id: I4d9c1e7eec7d5ae7c5a8d2e1a1ed95addff69966
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-11 13:26:57 +02:00
|
|
|
if (QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQueryToolPath(qmake,
|
|
|
|
|
false,
|
|
|
|
|
m_sharedId,
|
|
|
|
|
&error)) {
|
2022-04-07 14:04:20 +02:00
|
|
|
if (qtVersion->isValid()) {
|
|
|
|
|
if (!Utils::anyOf(qtVersions,
|
|
|
|
|
[qtVersion](QtVersion* other) {
|
|
|
|
|
return qtVersion->mkspecPath() == other->mkspecPath();
|
|
|
|
|
})) {
|
|
|
|
|
|
|
|
|
|
qtVersions.append(qtVersion);
|
|
|
|
|
QtVersionManager::addVersion(qtVersion);
|
|
|
|
|
emit q->logOutput(
|
QtSupport: Add support to register Qt versions via qtpaths
qmake is a "build tool", and it is also a "query tool" when called with
parameter "-query". Qt Creator, so far, assumes that building and
querying with a Qt installation are done with one and the same tool:
qmake. This change adds the ability to register a Qt version vie either
qmake or qtpaths and still build with qmake, if that is installed (which
is not anymore mandatory from Qt 6 on).
1) Distinguish between Qt query tool and qmake build tool:
Add QtVersion::queryToolFilePath() to the existing
QtVersion::qmakeFilePath(), and use queryToolFilePath in most "query"
related code, and qmakeFilePath when building with qmake (e.g. in
QmakeProjectManager).
Also, a couple of functions and variables were renamed from *qmake* to
*queryTool* in order to express that the affected code is about
querying/managing Qt versions rather than about building with qmake.
2) Support manual Qt Version adding by qtpaths via file dialog
This change adds qtpaths to the "Add" Qt Version file picker filter.
After selection, "qtpaths -query" is executed for testing purposes. If
that fails, (e.g. because it is an older Qt version), qmake is instead
chosen, silently.
Task-number: QTCREATORBUG-22175
Task-number: QTCREATORBUG-25546
Change-Id: I4d9c1e7eec7d5ae7c5a8d2e1a1ed95addff69966
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-11 13:26:57 +02:00
|
|
|
tr("Found \"%1\"").arg(qtVersion->queryToolFilePath().toUserOutput()));
|
2022-04-07 14:04:20 +02:00
|
|
|
}
|
|
|
|
|
}
|
2022-04-06 10:15:29 +02:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
emit q->logOutput(tr("Searching for qmake executables..."));
|
|
|
|
|
|
|
|
|
|
const QStringList candidates = {"qmake-qt6", "qmake-qt5", "qmake"};
|
|
|
|
|
for (const FilePath &searchPath : m_searchPaths) {
|
2022-04-07 09:01:21 +02:00
|
|
|
searchPath.iterateDirectory(handleQmake,
|
|
|
|
|
{candidates,
|
|
|
|
|
QDir::Files | QDir::Executable,
|
|
|
|
|
QDirIterator::Subdirectories});
|
2022-04-06 10:15:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!error.isEmpty())
|
|
|
|
|
emit q->logOutput(tr("Error: %1.").arg(error));
|
|
|
|
|
if (qtVersions.isEmpty())
|
|
|
|
|
emit q->logOutput(tr("No Qt installation found."));
|
|
|
|
|
return qtVersions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Toolchains KitDetectorPrivate::autoDetectToolChains()
|
|
|
|
|
{
|
|
|
|
|
const QList<ToolChainFactory *> factories = ToolChainFactory::allToolChainFactories();
|
|
|
|
|
|
|
|
|
|
Toolchains alreadyKnown = ToolChainManager::toolchains();
|
|
|
|
|
Toolchains allNewToolChains;
|
|
|
|
|
QApplication::processEvents();
|
|
|
|
|
emit q->logOutput('\n' + tr("Searching toolchains..."));
|
|
|
|
|
for (ToolChainFactory *factory : factories) {
|
|
|
|
|
emit q->logOutput(tr("Searching toolchains of type %1").arg(factory->displayName()));
|
|
|
|
|
const ToolchainDetector detector(alreadyKnown, m_device, m_searchPaths);
|
|
|
|
|
const Toolchains newToolChains = factory->autoDetect(detector);
|
|
|
|
|
for (ToolChain *toolChain : newToolChains) {
|
|
|
|
|
emit q->logOutput(tr("Found \"%1\"").arg(toolChain->compilerCommand().toUserOutput()));
|
|
|
|
|
toolChain->setDetectionSource(m_sharedId);
|
|
|
|
|
ToolChainManager::registerToolChain(toolChain);
|
|
|
|
|
alreadyKnown.append(toolChain);
|
|
|
|
|
}
|
|
|
|
|
allNewToolChains.append(newToolChains);
|
|
|
|
|
}
|
|
|
|
|
emit q->logOutput(tr("%1 new toolchains found.").arg(allNewToolChains.size()));
|
|
|
|
|
|
|
|
|
|
return allNewToolChains;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 14:04:20 +02:00
|
|
|
QList<Id> KitDetectorPrivate::autoDetectCMake()
|
2022-04-06 10:15:29 +02:00
|
|
|
{
|
2022-04-07 14:04:20 +02:00
|
|
|
QList<Id> result;
|
2022-04-06 10:15:29 +02:00
|
|
|
QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager");
|
|
|
|
|
if (!cmakeManager)
|
2022-04-07 14:04:20 +02:00
|
|
|
return {};
|
2022-04-06 10:15:29 +02:00
|
|
|
|
|
|
|
|
QString logMessage;
|
|
|
|
|
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
|
|
|
|
"autoDetectCMakeForDevice",
|
2022-04-07 14:04:20 +02:00
|
|
|
Q_RETURN_ARG(QList<Utils::Id>, result),
|
2022-04-06 10:15:29 +02:00
|
|
|
Q_ARG(Utils::FilePaths, m_searchPaths),
|
|
|
|
|
Q_ARG(QString, m_sharedId),
|
|
|
|
|
Q_ARG(QString *, &logMessage));
|
|
|
|
|
QTC_CHECK(res);
|
|
|
|
|
emit q->logOutput('\n' + logMessage);
|
2022-04-07 14:04:20 +02:00
|
|
|
|
|
|
|
|
return result;
|
2022-04-06 10:15:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetectorPrivate::autoDetectDebugger()
|
|
|
|
|
{
|
|
|
|
|
QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin");
|
|
|
|
|
if (!debuggerPlugin)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
QString logMessage;
|
|
|
|
|
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
|
|
|
|
"autoDetectDebuggersForDevice",
|
|
|
|
|
Q_ARG(Utils::FilePaths, m_searchPaths),
|
|
|
|
|
Q_ARG(QString, m_sharedId),
|
|
|
|
|
Q_ARG(QString *, &logMessage));
|
|
|
|
|
QTC_CHECK(res);
|
|
|
|
|
emit q->logOutput('\n' + logMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KitDetectorPrivate::autoDetect()
|
|
|
|
|
{
|
|
|
|
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
|
|
|
|
|
|
|
|
undoAutoDetect();
|
|
|
|
|
|
|
|
|
|
emit q->logOutput(tr("Starting auto-detection. This will take a while..."));
|
|
|
|
|
|
|
|
|
|
const Toolchains toolchains = autoDetectToolChains();
|
|
|
|
|
const QtVersions qtVersions = autoDetectQtVersions();
|
|
|
|
|
|
2022-04-07 14:04:20 +02:00
|
|
|
const QList<Id> cmakeIds = autoDetectCMake();
|
|
|
|
|
const Id cmakeId = cmakeIds.empty() ? Id() : cmakeIds.first();
|
2022-04-06 10:15:29 +02:00
|
|
|
autoDetectDebugger();
|
|
|
|
|
|
2022-04-07 14:04:20 +02:00
|
|
|
const auto initializeKit = [this, toolchains, qtVersions, cmakeId](Kit *k) {
|
2022-04-06 10:15:29 +02:00
|
|
|
k->setAutoDetected(false);
|
|
|
|
|
k->setAutoDetectionSource(m_sharedId);
|
|
|
|
|
k->setUnexpandedDisplayName("%{Device:Name}");
|
|
|
|
|
|
2022-04-07 14:04:20 +02:00
|
|
|
if (cmakeId.isValid())
|
|
|
|
|
k->setValue(CMakeProjectManager::Constants::TOOL_ID, cmakeId.toSetting());
|
|
|
|
|
|
2022-05-27 22:08:38 -04:00
|
|
|
DeviceTypeKitAspect::setDeviceTypeId(k, m_device->type());
|
2022-04-06 10:15:29 +02:00
|
|
|
DeviceKitAspect::setDevice(k, m_device);
|
2022-04-07 14:04:20 +02:00
|
|
|
BuildDeviceKitAspect::setDevice(k, m_device);
|
2022-04-06 10:15:29 +02:00
|
|
|
|
|
|
|
|
QtVersion *qt = nullptr;
|
|
|
|
|
if (!qtVersions.isEmpty()) {
|
|
|
|
|
qt = qtVersions.at(0);
|
|
|
|
|
QtSupport::QtKitAspect::setQtVersion(k, qt);
|
|
|
|
|
}
|
|
|
|
|
Toolchains toolchainsToSet;
|
2022-04-07 09:01:21 +02:00
|
|
|
toolchainsToSet = ToolChainManager::toolchains([qt, this](const ToolChain *tc) {
|
|
|
|
|
return tc->detectionSource() == m_sharedId
|
|
|
|
|
&& (!qt || qt->qtAbis().contains(tc->targetAbi()));
|
2022-04-06 10:15:29 +02:00
|
|
|
});
|
|
|
|
|
for (ToolChain *toolChain : toolchainsToSet)
|
|
|
|
|
ToolChainKitAspect::setToolChain(k, toolChain);
|
|
|
|
|
|
2022-04-07 14:04:20 +02:00
|
|
|
if (cmakeId.isValid())
|
|
|
|
|
k->setSticky(CMakeProjectManager::Constants::TOOL_ID, true);
|
|
|
|
|
|
2022-04-06 10:15:29 +02:00
|
|
|
k->setSticky(ToolChainKitAspect::id(), true);
|
|
|
|
|
k->setSticky(QtSupport::QtKitAspect::id(), true);
|
|
|
|
|
k->setSticky(DeviceKitAspect::id(), true);
|
|
|
|
|
k->setSticky(DeviceTypeKitAspect::id(), true);
|
2022-04-07 14:04:20 +02:00
|
|
|
k->setSticky(BuildDeviceKitAspect::id(), true);
|
2022-04-06 10:15:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Kit *kit = KitManager::registerKit(initializeKit);
|
|
|
|
|
emit q->logOutput('\n' + tr("Registered kit %1").arg(kit->displayName()));
|
|
|
|
|
|
|
|
|
|
QApplication::restoreOverrideCursor();
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 09:01:21 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Docker
|