makestep.h 3.39 KB
Newer Older
1
/**************************************************************************
dt's avatar
dt committed
2 3 4
**
** This file is part of Qt Creator
**
5
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
dt's avatar
dt committed
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
dt's avatar
dt committed
8
**
9
** Commercial Usage
dt's avatar
dt committed
10
**
11 12 13 14
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
dt's avatar
dt committed
15
**
16
** GNU Lesser General Public License Usage
dt's avatar
dt committed
17
**
18 19 20 21 22 23
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
dt's avatar
dt committed
24
**
25
** If you are unsure which license is appropriate for your use, please
26
** contact the sales department at http://www.qtsoftware.com/contact.
dt's avatar
dt committed
27
**
28
**************************************************************************/
dt's avatar
dt committed
29 30 31 32

#ifndef MAKESTEP_H
#define MAKESTEP_H

33
#include <projectexplorer/abstractmakestep.h>
dt's avatar
dt committed
34

35
QT_BEGIN_NAMESPACE
36 37 38
class QLineEdit;
class QListWidget;
class QListWidgetItem;
39
QT_END_NAMESPACE
40

dt's avatar
dt committed
41 42 43 44 45
namespace CMakeProjectManager {
namespace Internal {

class CMakeProject;

46
class MakeStep : public ProjectExplorer::AbstractMakeStep
dt's avatar
dt committed
47
{
48
    Q_OBJECT
dt's avatar
dt committed
49 50 51 52 53 54 55 56 57 58 59
public:
    MakeStep(CMakeProject *pro);
    ~MakeStep();
    virtual bool init(const QString &buildConfiguration);

    virtual void run(QFutureInterface<bool> &fi);

    virtual QString name();
    virtual QString displayName();
    virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
    virtual bool immutable() const;
60 61 62
    CMakeProject *project() const;
    bool buildsTarget(const QString &buildConfiguration, const QString &target) const;
    void setBuildTarget(const QString &buildConfiguration, const QString &target, bool on);
63 64
    QStringList additionalArguments(const QString &buildConfiguration) const;
    void setAdditionalArguments(const QString &buildConfiguration, const QStringList &list);
65
protected:
66
    // For parsing [ 76%]
67
    virtual void stdOut(const QString &line);
dt's avatar
dt committed
68 69
private:
    CMakeProject *m_pro;
70 71
    QRegExp m_percentProgress;
    QFutureInterface<bool> *m_futureInterface;
dt's avatar
dt committed
72 73
};

74
class MakeStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
dt's avatar
dt committed
75
{
76
    Q_OBJECT
dt's avatar
dt committed
77
public:
78
    MakeStepConfigWidget(MakeStep *makeStep);
dt's avatar
dt committed
79 80
    virtual QString displayName() const;
    virtual void init(const QString &buildConfiguration);
dt's avatar
dt committed
81
    virtual QString summaryText() const;
82 83
private slots:
    void itemChanged(QListWidgetItem*);
84
    void additionalArgumentsEdited();
85 86
private:
    QString m_buildConfiguration;
87
    MakeStep *m_makeStep;
88
    QListWidget *m_targetsList;
89
    QLineEdit *m_additionalArguments;
dt's avatar
dt committed
90 91
};

92
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
dt's avatar
dt committed
93 94 95 96 97 98 99
{
    virtual bool canCreate(const QString &name) const;
    virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, const QString &name) const;
    virtual QStringList canCreateForProject(ProjectExplorer::Project *pro) const;
    virtual QString displayNameForName(const QString &name) const;
};

100 101
} // namespace Internal
} // namespace CMakeProjectManager
dt's avatar
dt committed
102 103

#endif // MAKESTEP_H