2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2016-08-25 14:33:44 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <qtsupport/qtprojectimporter.h>
|
|
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
|
|
|
|
|
class CMakeTool;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class CMakeProjectImporter : public QtSupport::QtProjectImporter
|
|
|
|
|
{
|
2021-03-19 10:46:11 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeProjectImporter)
|
|
|
|
|
|
2016-08-25 14:33:44 +02:00
|
|
|
public:
|
2019-05-28 13:49:26 +02:00
|
|
|
CMakeProjectImporter(const Utils::FilePath &path);
|
2016-08-25 14:33:44 +02:00
|
|
|
|
|
|
|
|
QStringList importCandidates() final;
|
|
|
|
|
|
|
|
|
|
private:
|
2020-12-02 19:16:40 +01:00
|
|
|
QList<void *> examineDirectory(const Utils::FilePath &importPath,
|
|
|
|
|
QString *warningMessage) const final;
|
2016-08-25 14:33:44 +02:00
|
|
|
bool matchKit(void *directoryData, const ProjectExplorer::Kit *k) const final;
|
|
|
|
|
ProjectExplorer::Kit *createKit(void *directoryData) const final;
|
2020-01-09 18:42:28 +01:00
|
|
|
const QList<ProjectExplorer::BuildInfo> buildInfoList(void *directoryData) const final;
|
2016-08-25 14:33:44 +02:00
|
|
|
|
|
|
|
|
struct CMakeToolData {
|
|
|
|
|
bool isTemporary = false;
|
|
|
|
|
CMakeTool *cmakeTool = nullptr;
|
|
|
|
|
};
|
2019-05-28 13:49:26 +02:00
|
|
|
CMakeToolData findOrCreateCMakeTool(const Utils::FilePath &cmakeToolPath) const;
|
2016-08-25 14:33:44 +02:00
|
|
|
|
|
|
|
|
void deleteDirectoryData(void *directoryData) const final;
|
|
|
|
|
|
|
|
|
|
void cleanupTemporaryCMake(ProjectExplorer::Kit *k, const QVariantList &vl);
|
|
|
|
|
void persistTemporaryCMake(ProjectExplorer::Kit *k, const QVariantList &vl);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|