makestep.h 3.59 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 8
**
** Contact:  Qt Software Information (qt-info@nokia.com)
**
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 26
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
dt's avatar
dt committed
27
**
28
**************************************************************************/
dt's avatar
dt committed
29 30 31 32 33 34

#ifndef MAKESTEP_H
#define MAKESTEP_H

#include <projectexplorer/abstractprocessstep.h>

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 46 47
namespace CMakeProjectManager {
namespace Internal {

class CMakeProject;

class MakeStep : public ProjectExplorer::AbstractProcessStep
{
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 66 67 68 69 70 71
private slots:
    void slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description);
    void addDirectory(const QString &dir);
    void removeDirectory(const QString &dir);
protected:
    virtual void stdOut(const QString &line);
    virtual void stdError(const QString &line);
dt's avatar
dt committed
72 73
private:
    CMakeProject *m_pro;
74 75
    ProjectExplorer::BuildParserInterface *m_buildParser;
    QSet<QString> m_openDirectories;
dt's avatar
dt committed
76 77
};

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

95
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
dt's avatar
dt committed
96 97 98 99 100 101 102
{
    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;
};

103 104
} // namespace Internal
} // namespace CMakeProjectManager
dt's avatar
dt committed
105 106

#endif // MAKESTEP_H