-
Notifications
You must be signed in to change notification settings - Fork 9
/
cmakeprojectimporter.h
55 lines (38 loc) · 1.75 KB
/
cmakeprojectimporter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "presetsparser.h"
#include <qtsupport/qtprojectimporter.h>
#include <utils/temporarydirectory.h>
namespace CMakeProjectManager {
class CMakeProject;
class CMakeTool;
namespace Internal {
struct DirectoryData;
class CMakeProjectImporter : public QtSupport::QtProjectImporter
{
public:
CMakeProjectImporter(const Utils::FilePath &path,
const CMakeProjectManager::CMakeProject *project);
Utils::FilePaths importCandidates() final;
ProjectExplorer::Target *preferredTarget(const QList<ProjectExplorer::Target *> &possibleTargets) final;
private:
QList<void *> examineDirectory(const Utils::FilePath &importPath,
QString *warningMessage) const final;
bool matchKit(void *directoryData, const ProjectExplorer::Kit *k) const final;
ProjectExplorer::Kit *createKit(void *directoryData) const final;
const QList<ProjectExplorer::BuildInfo> buildInfoList(void *directoryData) const final;
struct CMakeToolData {
bool isTemporary = false;
CMakeTool *cmakeTool = nullptr;
};
CMakeToolData findOrCreateCMakeTool(const Utils::FilePath &cmakeToolPath) const;
void deleteDirectoryData(void *directoryData) const final;
void cleanupTemporaryCMake(ProjectExplorer::Kit *k, const QVariantList &vl);
void persistTemporaryCMake(ProjectExplorer::Kit *k, const QVariantList &vl);
void ensureBuildDirectory(DirectoryData &data, const ProjectExplorer::Kit *k) const;
const CMakeProject *m_project;
Utils::TemporaryDirectory m_presetsTempDir;
};
} // namespace Internal
} // namespace CMakeProjectManager