forked from qt-creator/qt-creator
The CMake presets will be reloaded. The preset kits will get the CMake configuration cleared (no more CMakeCache.txt) All the kits will be removed from the project, so that the Kit configuration wizard will be displayed at the end. If a normal Qt Kit was configured, the user will get the chance to import the existing configuration (the initial configuration will be lost though). Change-Id: Ieda83098d7716913d7870b67ab522705da4ed93b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: hjk <hjk@qt.io>
56 lines
1.8 KiB
C++
56 lines
1.8 KiB
C++
// 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
|