source: branches/vendor/trolltech/qt/current/tools/configure/configureapp.h @ 2

Last change on this file since 2 was 2, checked in by Dmitry A. Kuminov, 13 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.4 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information (qt-info@nokia.com)
5**
6** This file is part of the tools applications of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file.  Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file.  Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at qt-sales@nokia.com.
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include <qmap.h>
43#include <qstring.h>
44#include <qstringlist.h>
45#include <qlist.h>
46#include <qtextstream.h>
47#include <qdir.h>
48
49QT_BEGIN_NAMESPACE
50
51class MakeItem;
52
53class Configure
54{
55public:
56    Configure( int& argc, char** argv );
57    ~Configure();
58
59    void parseCmdLine();
60#if !defined(EVAL)
61    void validateArgs();
62#endif
63    bool displayHelp();
64
65    QString defaultTo(const QString &option);
66    bool checkAvailability(const QString &part);
67    void autoDetection();
68    bool verifyConfiguration();
69
70    void generateOutputVars();
71#if !defined(EVAL)
72    void generateHeaders();
73    void generateBuildKey();
74    void generateCachefile();
75    void displayConfig();
76    void buildQmake();
77    void buildHostTools();
78#endif
79    void generateMakefiles();
80    void appendMakeItem(int inList, const QString &item);
81#if !defined(EVAL)
82    void generateConfigfiles();
83#endif
84    void showSummary();
85    void findProjects( const QString& dirName );
86    QString firstLicensePath();
87
88#if !defined(EVAL)
89    bool showLicense(QString licenseFile);
90    void readLicense();
91#endif
92
93    QString addDefine(QString def);
94
95    enum ProjectType {
96        App,
97        Lib,
98        Subdirs
99    };
100
101    ProjectType projectType( const QString& proFileName );
102    bool isDone();
103    bool isOk();
104private:
105    // Our variable dictionaries
106    QMap<QString,QString> dictionary;
107    QStringList licensedModules;
108    QStringList allSqlDrivers;
109    QStringList allConfigs;
110    QStringList disabledModules;
111    QStringList enabledModules;
112    QStringList modules;
113    QStringList disabledBuildParts;
114//    QStringList sqlDrivers;
115    QStringList configCmdLine;
116    QStringList qmakeConfig;
117    QStringList qtConfig;
118
119    QStringList qmakeSql;
120    QStringList qmakeSqlPlugins;
121
122    QStringList qmakeStyles;
123    QStringList qmakeStylePlugins;
124
125    QStringList qmakeFormatPlugins;
126
127    QStringList qmakeVars;
128    QStringList qmakeDefines;
129    //  makeList[0] for qt and qtmain
130    //  makeList[1] for subdirs and libs
131    //  makeList[2] for the rest
132    QList<MakeItem*> makeList[3];
133    QStringList qmakeIncludes;
134    QStringList qmakeLibs;
135    QString opensslLibs;
136
137    QMap<QString,QString> licenseInfo;
138    QString outputLine;
139
140    QTextStream outStream;
141    QString sourcePath, buildPath;
142    QDir sourceDir, buildDir;
143
144    // Variables for usage output
145    int optionIndent;
146    int descIndent;
147    int outputWidth;
148
149    bool useUnixSeparators;
150    QString fixSeparators(QString somePath);
151    bool filesDiffer(const QString &file1, const QString &file2);
152
153    static bool findFile(const QString &fileName);
154    static bool findFileInPaths(const QString &fileName, const QStringList &paths);
155#if !defined(EVAL)
156    void reloadCmdLine();
157    void saveCmdLine();
158#endif
159
160    void desc(const char *description, int startingAt = 0, int wrapIndent = 0);
161    void desc(const char *option, const char *description, bool skipIndent = false, char fillChar = '.');
162    void desc(const char *mark_option, const char *mark, const char *option, const char *description, char fillChar = '.');
163    void applySpecSpecifics();
164    static QString locateFile(const QString &fileName);
165    static QString locateFileInPaths(const QString &fileName, const QStringList &paths);
166};
167
168class MakeItem
169{
170public:
171    MakeItem( const QString &d, const QString &p, const QString &t, Configure::ProjectType qt )
172        : directory( d ),
173          proFile( p ),
174          target( t ),
175          qmakeTemplate( qt )
176    { }
177
178    QString directory;
179    QString proFile;
180    QString target;
181    Configure::ProjectType qmakeTemplate;
182};
183
184
185QT_END_NAMESPACE
Note: See TracBrowser for help on using the repository browser.