Fixing warnings in QScopedPointer test case
[qt-netbsd.git] / tools / configure / configureapp.h
blob47354240ec08f57e6727d588dee07e9dd134c55d
1 /****************************************************************************
2 **
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the tools applications of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
38 ** $QT_END_LICENSE$
40 ****************************************************************************/
42 #include <qmap.h>
43 #include <qstring.h>
44 #include <qstringlist.h>
45 #include <qlist.h>
46 #include <qtextstream.h>
47 #include <qdir.h>
49 QT_BEGIN_NAMESPACE
51 class MakeItem;
53 class Configure
55 public:
56 Configure( int& argc, char** argv );
57 ~Configure();
59 void parseCmdLine();
60 #if !defined(EVAL)
61 void validateArgs();
62 #endif
63 bool displayHelp();
65 QString defaultTo(const QString &option);
66 bool checkAvailability(const QString &part);
67 void autoDetection();
68 bool verifyConfiguration();
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();
88 #if !defined(EVAL)
89 bool showLicense(QString licenseFile);
90 void readLicense();
91 #endif
93 QString addDefine(QString def);
95 enum ProjectType {
96 App,
97 Lib,
98 Subdirs
101 ProjectType projectType( const QString& proFileName );
102 bool isDone();
103 bool isOk();
104 private:
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;
119 QStringList qmakeSql;
120 QStringList qmakeSqlPlugins;
122 QStringList qmakeStyles;
123 QStringList qmakeStylePlugins;
125 QStringList qmakeFormatPlugins;
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;
137 QMap<QString,QString> licenseInfo;
138 QString outputLine;
140 QTextStream outStream;
141 QString sourcePath, buildPath;
142 QDir sourceDir, buildDir;
144 // Variables for usage output
145 int optionIndent;
146 int descIndent;
147 int outputWidth;
149 bool useUnixSeparators;
150 QString fixSeparators(QString somePath);
151 bool filesDiffer(const QString &file1, const QString &file2);
153 bool findFile(const QString &fileName);
154 static QString findFileInPaths(const QString &fileName, const QString &paths);
155 #if !defined(EVAL)
156 void reloadCmdLine();
157 void saveCmdLine();
158 #endif
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);
168 class MakeItem
170 public:
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 )
178 QString directory;
179 QString proFile;
180 QString target;
181 Configure::ProjectType qmakeTemplate;
185 QT_END_NAMESPACE