2015-02-24 21:57:00 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 Canonical Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2015-02-24 21:57:00 +01:00
|
|
|
**
|
|
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2015-02-24 21:57:00 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2015-02-24 21:57:00 +01:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2016-01-27 10:14:00 +01:00
|
|
|
#pragma once
|
2015-02-24 21:57:00 +01:00
|
|
|
|
2019-09-25 18:50:58 +02:00
|
|
|
#include "cmake_global.h"
|
|
|
|
|
|
2016-02-12 12:23:18 +01:00
|
|
|
#include "cmakeconfigitem.h"
|
|
|
|
|
|
2015-02-24 21:57:00 +01:00
|
|
|
#include <projectexplorer/kitmanager.h>
|
|
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
class CMakeTool;
|
|
|
|
|
|
2019-09-25 18:50:58 +02:00
|
|
|
class CMAKE_EXPORT CMakeKitAspect : public ProjectExplorer::KitAspect
|
2015-02-24 21:57:00 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
CMakeKitAspect();
|
2015-02-24 21:57:00 +01:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
static Utils::Id id();
|
2016-08-25 14:33:44 +02:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
static Utils::Id cmakeToolId(const ProjectExplorer::Kit *k);
|
2015-02-24 21:57:00 +01:00
|
|
|
static CMakeTool *cmakeTool(const ProjectExplorer::Kit *k);
|
2020-06-26 13:59:38 +02:00
|
|
|
static void setCMakeTool(ProjectExplorer::Kit *k, const Utils::Id id);
|
2015-02-24 21:57:00 +01:00
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
// KitAspect interface
|
2019-05-27 16:09:44 +02:00
|
|
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
2016-09-27 12:36:02 +02:00
|
|
|
void setup(ProjectExplorer::Kit *k) final;
|
|
|
|
|
void fix(ProjectExplorer::Kit *k) final;
|
|
|
|
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
2019-02-06 12:50:51 +01:00
|
|
|
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
|
2016-09-27 12:36:02 +02:00
|
|
|
|
|
|
|
|
void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final;
|
2017-04-03 14:31:32 +02:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const final;
|
2020-11-19 09:45:55 +01:00
|
|
|
|
|
|
|
|
static QString msgUnsupportedVersion(const QByteArray &versionString);
|
2015-02-24 21:57:00 +01:00
|
|
|
};
|
|
|
|
|
|
2019-09-25 18:50:58 +02:00
|
|
|
class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspect
|
2016-01-22 17:17:36 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
CMakeGeneratorKitAspect();
|
2016-01-22 17:17:36 +01:00
|
|
|
|
|
|
|
|
static QString generator(const ProjectExplorer::Kit *k);
|
2016-09-27 13:26:54 +02:00
|
|
|
static QString extraGenerator(const ProjectExplorer::Kit *k);
|
|
|
|
|
static QString platform(const ProjectExplorer::Kit *k);
|
|
|
|
|
static QString toolset(const ProjectExplorer::Kit *k);
|
2016-01-22 17:17:36 +01:00
|
|
|
static void setGenerator(ProjectExplorer::Kit *k, const QString &generator);
|
2016-09-27 13:26:54 +02:00
|
|
|
static void setExtraGenerator(ProjectExplorer::Kit *k, const QString &extraGenerator);
|
|
|
|
|
static void setPlatform(ProjectExplorer::Kit *k, const QString &platform);
|
|
|
|
|
static void setToolset(ProjectExplorer::Kit *k, const QString &toolset);
|
2016-09-28 12:24:06 +02:00
|
|
|
static void set(ProjectExplorer::Kit *k, const QString &generator,
|
|
|
|
|
const QString &extraGenerator, const QString &platform, const QString &toolset);
|
2016-09-27 13:26:54 +02:00
|
|
|
static QStringList generatorArguments(const ProjectExplorer::Kit *k);
|
2021-01-14 16:38:55 +01:00
|
|
|
static bool isMultiConfigGenerator(const ProjectExplorer::Kit *k);
|
2016-01-22 17:17:36 +01:00
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
// KitAspect interface
|
2019-05-27 16:09:44 +02:00
|
|
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
2016-09-27 12:36:02 +02:00
|
|
|
void setup(ProjectExplorer::Kit *k) final;
|
|
|
|
|
void fix(ProjectExplorer::Kit *k) final;
|
2016-09-27 13:26:54 +02:00
|
|
|
void upgrade(ProjectExplorer::Kit *k) final;
|
2016-09-27 12:36:02 +02:00
|
|
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
2019-02-06 12:50:51 +01:00
|
|
|
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
|
2021-05-25 16:44:20 +02:00
|
|
|
void addToBuildEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const final;
|
2019-03-12 16:50:39 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QVariant defaultValue(const ProjectExplorer::Kit *k) const;
|
2016-01-22 17:17:36 +01:00
|
|
|
};
|
|
|
|
|
|
2019-09-25 18:50:58 +02:00
|
|
|
class CMAKE_EXPORT CMakeConfigurationKitAspect : public ProjectExplorer::KitAspect
|
2016-02-12 12:23:18 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
CMakeConfigurationKitAspect();
|
2016-02-12 12:23:18 +01:00
|
|
|
|
|
|
|
|
static CMakeConfig configuration(const ProjectExplorer::Kit *k);
|
|
|
|
|
static void setConfiguration(ProjectExplorer::Kit *k, const CMakeConfig &config);
|
|
|
|
|
|
|
|
|
|
static QStringList toStringList(const ProjectExplorer::Kit *k);
|
|
|
|
|
static void fromStringList(ProjectExplorer::Kit *k, const QStringList &in);
|
|
|
|
|
|
2020-04-02 14:49:05 +02:00
|
|
|
static QStringList toArgumentsList(const ProjectExplorer::Kit *k);
|
|
|
|
|
|
2016-04-06 15:29:39 +02:00
|
|
|
static CMakeConfig defaultConfiguration(const ProjectExplorer::Kit *k);
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
// KitAspect interface
|
2019-05-27 16:09:44 +02:00
|
|
|
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
2016-09-27 12:36:02 +02:00
|
|
|
void setup(ProjectExplorer::Kit *k) final;
|
|
|
|
|
void fix(ProjectExplorer::Kit *k) final;
|
|
|
|
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
2019-02-06 12:50:51 +01:00
|
|
|
ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final;
|
2019-03-12 16:50:39 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QVariant defaultValue(const ProjectExplorer::Kit *k) const;
|
2016-02-12 12:23:18 +01:00
|
|
|
};
|
|
|
|
|
|
2015-02-24 21:57:00 +01:00
|
|
|
} // namespace CMakeProjectManager
|