2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-11-23 12:11:48 +01: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
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2009-11-23 12:11:48 +01:00
|
|
|
|
|
|
|
|
#ifndef CMAKEBUILDCONFIGURATION_H
|
|
|
|
|
#define CMAKEBUILDCONFIGURATION_H
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/buildconfiguration.h>
|
2011-02-01 18:36:00 +01:00
|
|
|
#include <projectexplorer/abi.h>
|
2010-11-01 14:14:17 +01:00
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace ProjectExplorer { class ToolChain; }
|
2009-11-23 12:11:48 +01:00
|
|
|
|
2009-11-23 13:29:45 +01:00
|
|
|
namespace CMakeProjectManager {
|
2013-07-22 15:53:57 +02:00
|
|
|
class CMakeBuildInfo;
|
2015-03-10 14:24:14 +01:00
|
|
|
class CMakeProject;
|
2013-07-22 15:53:57 +02:00
|
|
|
|
2009-11-23 13:29:45 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-01-18 12:11:04 +01:00
|
|
|
class CMakeBuildConfigurationFactory;
|
2009-11-23 13:29:45 +01:00
|
|
|
|
2009-11-23 12:11:48 +01:00
|
|
|
class CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
|
|
|
|
|
{
|
2009-11-25 18:49:59 +01:00
|
|
|
Q_OBJECT
|
2010-01-18 12:11:04 +01:00
|
|
|
friend class CMakeBuildConfigurationFactory;
|
|
|
|
|
|
2009-11-23 12:11:48 +01:00
|
|
|
public:
|
2012-04-24 15:49:09 +02:00
|
|
|
CMakeBuildConfiguration(ProjectExplorer::Target *parent);
|
2009-11-25 18:50:20 +01:00
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
ProjectExplorer::NamedWidget *createConfigWidget() override;
|
2009-12-03 19:45:09 +01:00
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
QVariantMap toMap() const override;
|
2009-12-08 12:21:11 +01:00
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
BuildType buildType() const override;
|
2011-03-03 16:12:00 +01:00
|
|
|
|
2014-06-19 15:29:11 +02:00
|
|
|
void emitBuildTypeChanged();
|
|
|
|
|
|
2015-09-10 16:17:38 +02:00
|
|
|
void setInitialArguments(const QString &arguments);
|
|
|
|
|
QString initialArguments() const;
|
|
|
|
|
|
2010-01-18 12:11:04 +01:00
|
|
|
protected:
|
2012-04-24 15:49:09 +02:00
|
|
|
CMakeBuildConfiguration(ProjectExplorer::Target *parent, CMakeBuildConfiguration *source);
|
2016-01-07 15:22:53 +01:00
|
|
|
bool fromMap(const QVariantMap &map) override;
|
2010-01-18 12:11:04 +01:00
|
|
|
|
2009-11-25 18:50:20 +01:00
|
|
|
private:
|
2015-09-10 16:17:38 +02:00
|
|
|
QString m_initialArguments;
|
2013-08-16 17:45:16 +02:00
|
|
|
|
2015-03-10 14:24:14 +01:00
|
|
|
friend class CMakeProjectManager::CMakeProject;
|
2009-11-23 12:11:48 +01:00
|
|
|
};
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
class CMakeBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2010-01-18 12:11:04 +01:00
|
|
|
CMakeBuildConfigurationFactory(QObject *parent = 0);
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
int priority(const ProjectExplorer::Target *parent) const override;
|
|
|
|
|
QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
|
|
|
|
int priority(const ProjectExplorer::Kit *k, const QString &projectPath) const override;
|
2013-08-13 10:52:57 +02:00
|
|
|
QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k,
|
2016-01-07 15:22:53 +01:00
|
|
|
const QString &projectPath) const override;
|
2013-07-22 15:53:57 +02:00
|
|
|
ProjectExplorer::BuildConfiguration *create(ProjectExplorer::Target *parent,
|
2016-01-07 15:22:53 +01:00
|
|
|
const ProjectExplorer::BuildInfo *info) const override;
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
bool canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) const override;
|
|
|
|
|
CMakeBuildConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) override;
|
|
|
|
|
bool canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const override;
|
|
|
|
|
CMakeBuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map) override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool canHandle(const ProjectExplorer::Target *t) const;
|
2015-09-10 16:17:38 +02:00
|
|
|
|
|
|
|
|
enum BuildType { BuildTypeNone = 0,
|
|
|
|
|
BuildTypeDebug = 1,
|
|
|
|
|
BuildTypeRelease = 2,
|
|
|
|
|
BuildTypeRelWithDebInfo = 3,
|
|
|
|
|
BuildTypeMinSizeRel = 4,
|
|
|
|
|
BuildTypeLast = 5 };
|
|
|
|
|
|
|
|
|
|
CMakeBuildInfo *createBuildInfo(const ProjectExplorer::Kit *k,
|
|
|
|
|
const QString &sourceDir,
|
|
|
|
|
BuildType buildType) const;
|
2010-01-07 18:17:24 +01:00
|
|
|
};
|
2009-11-23 13:29:45 +01:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|
|
|
|
|
|
2009-11-23 12:11:48 +01:00
|
|
|
#endif // CMAKEBUILDCONFIGURATION_H
|