2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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.
|
2012-04-24 15:49:09 +02: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.
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#ifndef KITINFORMATION_H
|
|
|
|
|
#define KITINFORMATION_H
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#include "kitmanager.h"
|
|
|
|
|
#include "kit.h"
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
#include "devicesupport/idevice.h"
|
2014-07-22 21:12:34 +02:00
|
|
|
#include <utils/environment.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2013-03-25 17:13:18 +01:00
|
|
|
class ToolChain;
|
2012-09-03 18:31:44 +02:00
|
|
|
class KitConfigWidget;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// SysRootInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
class PROJECTEXPLORER_EXPORT SysRootKitInformation : public KitInformation
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2012-09-03 18:31:44 +02:00
|
|
|
SysRootKitInformation();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QVariant defaultValue(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QList<Task> validate(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
KitConfigWidget *createConfigWidget(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static bool hasSysRoot(const Kit *k);
|
|
|
|
|
static Utils::FileName sysRoot(const Kit *k);
|
|
|
|
|
static void setSysRoot(Kit *k, const Utils::FileName &v);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// ToolChainInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
class PROJECTEXPLORER_EXPORT ToolChainKitInformation : public KitInformation
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2012-09-03 18:31:44 +02:00
|
|
|
ToolChainKitInformation();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QVariant defaultValue(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QList<Task> validate(const Kit *k) const override;
|
|
|
|
|
void fix(Kit *k) override;
|
|
|
|
|
void setup(Kit *k) override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
KitConfigWidget *createConfigWidget(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QString displayNamePostfix(const Kit *k) const override;
|
2012-08-07 13:09:56 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
void addToEnvironment(const Kit *k, Utils::Environment &env) const override;
|
|
|
|
|
void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override;
|
|
|
|
|
IOutputParser *createOutputParser(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static ToolChain *toolChain(const Kit *k);
|
|
|
|
|
static void setToolChain(Kit *k, ToolChain *tc);
|
2012-07-27 15:43:00 +02:00
|
|
|
|
|
|
|
|
static QString msgNoToolChainInTarget();
|
2013-07-24 16:22:37 +02:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2013-02-28 15:07:01 +01:00
|
|
|
void kitsWereLoaded();
|
2012-10-17 17:27:17 +02:00
|
|
|
void toolChainUpdated(ProjectExplorer::ToolChain *tc);
|
2013-02-28 15:07:01 +01:00
|
|
|
void toolChainRemoved(ProjectExplorer::ToolChain *tc);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// DeviceTypeInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
class PROJECTEXPLORER_EXPORT DeviceTypeKitInformation : public KitInformation
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2012-09-03 18:31:44 +02:00
|
|
|
DeviceTypeKitInformation();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QVariant defaultValue(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QList<Task> validate(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
KitConfigWidget *createConfigWidget(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static const Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static const Core::Id deviceTypeId(const Kit *k);
|
|
|
|
|
static void setDeviceTypeId(Kit *k, Core::Id type);
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2014-07-23 09:09:20 +02:00
|
|
|
static KitMatcher deviceTypeMatcher(Core::Id type);
|
2014-07-29 15:15:27 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QSet<Core::Id> supportedPlatforms(const Kit *k) const override;
|
|
|
|
|
QSet<Core::Id> availableFeatures(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// DeviceInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
class PROJECTEXPLORER_EXPORT DeviceKitInformation : public KitInformation
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2012-09-03 18:31:44 +02:00
|
|
|
DeviceKitInformation();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QVariant defaultValue(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QList<Task> validate(const Kit *k) const override;
|
|
|
|
|
void fix(Kit *k) override;
|
|
|
|
|
void setup(Kit *k) override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
KitConfigWidget *createConfigWidget(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QString displayNamePostfix(const Kit *k) const override;
|
2012-08-07 13:09:56 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
virtual void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override;
|
2014-10-22 10:00:07 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static IDevice::ConstPtr device(const Kit *k);
|
|
|
|
|
static Core::Id deviceId(const Kit *k);
|
|
|
|
|
static void setDevice(Kit *k, IDevice::ConstPtr dev);
|
2014-07-01 11:08:26 +02:00
|
|
|
static void setDeviceId(Kit *k, Core::Id dataId);
|
2013-07-24 16:22:37 +02:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2013-02-28 14:06:17 +01:00
|
|
|
void kitsWereLoaded();
|
2014-07-01 11:08:26 +02:00
|
|
|
void deviceUpdated(Core::Id dataId);
|
2013-07-08 16:39:03 +02:00
|
|
|
void devicesChanged();
|
2013-02-28 18:29:16 +01:00
|
|
|
void kitUpdated(ProjectExplorer::Kit *k);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
2014-07-22 21:12:34 +02:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// EnvironmentKitInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
class PROJECTEXPLORER_EXPORT EnvironmentKitInformation : public KitInformation
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
EnvironmentKitInformation();
|
|
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QVariant defaultValue(Kit *k) const override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QList<Task> validate(const Kit *k) const override;
|
|
|
|
|
void fix(Kit *k) override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
void addToEnvironment(const Kit *k, Utils::Environment &env) const override;
|
|
|
|
|
KitConfigWidget *createConfigWidget(Kit *k) const override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
|
|
|
|
static Core::Id id();
|
|
|
|
|
static QList<Utils::EnvironmentItem> environmentChanges(const Kit *k);
|
|
|
|
|
static void setEnvironmentChanges(Kit *k, const QList<Utils::EnvironmentItem> &changes);
|
|
|
|
|
};
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
} // namespace ProjectExplorer
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#endif // KITINFORMATION_H
|