40 #include <private/qlibraryinfo_p.h>
105 if(progname ==
"qmakegen")
107 else if(progname ==
"qt-config")
120 if(profiles.count() == 1)
121 ret =
dir.filePath(profiles.at(0));
128 fprintf(stdout,
"Usage: %s [mode] [options] [files]\n"
130 "QMake has two modes, one mode for generating project files based on\n"
131 "some heuristics, and the other for generating makefiles. Normally you\n"
132 "shouldn't need to specify a mode, as makefile generation is the default\n"
133 "mode for qmake, but you may use this to test qmake on an existing project\n"
136 " -project Put qmake into project file generation mode%s\n"
137 " In this mode qmake interprets [files] as files to\n"
138 " be added to the .pro file. By default, all files with\n"
139 " known source extensions are added.\n"
140 " Note: The created .pro file probably will \n"
141 " need to be edited. For example add the QT variable to \n"
142 " specify what modules are required.\n"
143 " -makefile Put qmake into makefile generation mode%s\n"
144 " In this mode qmake interprets files as project files to\n"
145 " be processed, if skipped qmake will try to find a project\n"
146 " file in your current working directory\n"
148 "Warnings Options:\n"
149 " -Wnone Turn off all warnings; specific ones may be re-enabled by\n"
150 " later -W options\n"
151 " -Wall Turn on all warnings\n"
152 " -Wparser Turn on parser warnings\n"
153 " -Wlogic Turn on logic warnings (on by default)\n"
154 " -Wdeprecated Turn on deprecation warnings (on by default)\n"
157 " * You can place any variable assignment in options and it will be *\n"
158 " * processed as if it was in [files]. These assignments will be *\n"
159 " * processed before [files] by default. *\n"
160 " -o file Write output to file\n"
161 " -d Increase debug level\n"
162 " -t templ Overrides TEMPLATE as templ\n"
163 " -tp prefix Overrides TEMPLATE so that prefix is prefixed into the value\n"
165 " -v Version information\n"
166 " -early All subsequent variable assignments will be\n"
167 " parsed right before default_pre.prf\n"
168 " -before All subsequent variable assignments will be\n"
169 " parsed right before [files] (the default)\n"
170 " -after All subsequent variable assignments will be\n"
171 " parsed after [files]\n"
172 " -late All subsequent variable assignments will be\n"
173 " parsed right after default_post.prf\n"
174 " -norecursive Don't do a recursive search\n"
175 " -recursive Do a recursive search\n"
176 " -set <prop> <value> Set persistent property\n"
177 " -unset <prop> Unset persistent property\n"
178 " -query <prop> Query persistent property. Show all if <prop> is empty.\n"
179 " -qtconf file Use file instead of looking for qt" QT_STRINGIFY(QT_VERSION_MAJOR)
".conf, then qt.conf\n"
180 " -cache file Use file as cache [makefile mode only]\n"
181 " -spec spec Use spec as QMAKESPEC [makefile mode only]\n"
182 " -nocache Don't use a cache file [makefile mode only]\n"
183 " -nodepend Don't generate dependencies [makefile mode only]\n"
184 " -nomoc Don't generate moc targets [makefile mode only]\n"
185 " -nopwd Don't look for files in pwd [project mode only]\n"
196 enum { ArgNone, ArgOutput } argState = ArgNone;
198 while (
x <
args.count()) {
208 fprintf(stderr,
"***Option %s requires a parameter\n", qPrintable(
args.at(
x - 1)));
211 if (!globals->qtconf.isEmpty())
212 QLibraryInfoPrivate::qtconfManualPath = &globals->qtconf;
220 }
else if (
arg ==
"-v" ||
arg ==
"-version" ||
arg ==
"--version") {
223 "Using Qt version %s in %s\n",
224 QMAKE_VERSION_STR, QT_VERSION_STR,
228 #ifdef QMAKE_OPENSOURCE_VERSION
229 fprintf(stdout,
"QMake is Open Source software from The Qt Company Ltd and/or its subsidiary(-ies).\n");
232 }
else if (
arg ==
"-h" ||
arg ==
"-help" ||
arg ==
"--help") {
234 }
else if (
arg ==
"-Wall") {
236 }
else if (
arg ==
"-Wparser") {
238 }
else if (
arg ==
"-Wlogic") {
240 }
else if (
arg ==
"-Wdeprecated") {
242 }
else if (
arg ==
"-Wnone") {
244 }
else if (
arg ==
"-r" ||
arg ==
"-recursive") {
248 }
else if (
arg ==
"-nr" ||
arg ==
"-norecursive") {
252 }
else if (
arg ==
"-o" ||
arg ==
"-output") {
253 argState = ArgOutput;
257 if (
arg ==
"-nodepend" ||
arg ==
"-nodepends") {
259 }
else if (
arg ==
"-nomoc") {
261 }
else if (
arg ==
"-nodependheuristics") {
263 }
else if (
arg ==
"-E") {
266 fprintf(stderr,
"***Unknown option %s\n",
arg.toLatin1().constData());
270 if (
arg ==
"-nopwd") {
273 fprintf(stderr,
"***Unknown option %s\n",
arg.toLatin1().constData());
311 if (argState != ArgNone) {
312 fprintf(stderr,
"***Option %s requires a parameter\n", qPrintable(
args.at(
x - 1)));
334 if (
Q_UNLIKELY(globals->qmake_abslocation.isNull())) {
336 globals->qmake_abslocation =
350 const QByteArray envflags = qgetenv(
"QMAKEFLAGS");
355 bool hasWord =
false;
356 for (
int i = 0;
i < envflags.
size(); ++
i) {
357 char c = envflags.
at(
i);
358 if (!quote && (
c ==
'\'' ||
c ==
'"')) {
360 }
else if (
c == quote) {
362 }
else if (!quote &&
c ==
' ') {
380 args.reserve(argc - 1);
381 for (
int i = 1;
i < argc;
i++)
387 if (
opt ==
"-project") {
390 }
else if (
opt ==
"-prl") {
394 }
else if (
opt ==
"-set") {
396 }
else if (
opt ==
"-unset") {
398 }
else if (
opt ==
"-query") {
400 }
else if (
opt ==
"-makefile") {
402 }
else if (
opt ==
"-qtconf") {
422 globals->qmake_args =
args;
423 globals->qmake_extra_args = cmdstate.
extraargs;
425 globals->commitCommandLineArguments(cmdstate);
431 globals->useEnvironment();
445 return QMAKE_CMDLINE_SUCCESS;
453 globals->setDirectories(srcpath, output_dir);
507 while ((match = reg_var.
match(
string)).hasMatch()) {
530 string.replace(
'\\',
'/');
532 #if defined(Q_OS_WIN32)
533 string.replace(
'/',
'\\');
535 string.replace(
'\\',
'/');
543 string =
string.mid(1,
string.
length()-2);
547 cache->insert(cacheKey,
string);
555 fprintf(stderr,
"DEBUG %d: ",
level);
559 vfprintf(stderr, fmt, ap);
562 fprintf(stderr,
"\n");
569 fprintf(stderr,
"WARNING: ");
573 vfprintf(stderr, fmt, ap);
576 fprintf(stderr,
"\n");
590 fprintf(stderr,
"%s%s:%d: %s\n", qPrintable(pfx), qPrintable(
fileName), lineNo, qPrintable(
msg));
592 fprintf(stderr,
"%s%s: %s\n", qPrintable(pfx), qPrintable(
fileName), qPrintable(
msg));
594 fprintf(stderr,
"%s%s\n", qPrintable(pfx), qPrintable(
msg));
600 fprintf(stderr,
"%s\n", qPrintable(
msg));
small capitals from c petite p scientific i
[1]
void qmakeDeleteCacheClear(void *i)
void(* qmakeCacheClearFunc)(void *)
void message(int type, const QString &msg, const QString &fileName, int lineNo) override
void fileMessage(int type, const QString &msg) override
void doneWithEval(ProFile *) override
void aboutToEval(ProFile *, ProFile *, EvalFileType) override
QString toQString() const
QStringList toQStringList() const
The QByteArray class provides an array of bytes.
qsizetype size() const noexcept
char at(qsizetype i) const
bool isNull() const noexcept
The QDir class provides access to directory structures and their contents.
static QString cleanPath(const QString &path)
static QString currentPath()
The QFile class provides an interface for reading from and writing to files.
void setFileName(const QString &name)
The QFileInfo class provides system-independent file information.
QString canonicalFilePath() const
The QHash::const_iterator class provides an STL-style const iterator for QHash.
The QHash class is a template class that provides a hash-table-based dictionary.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
QMakeCacheClearItem(qmakeCacheClearFunc f, void **d)
static QString binaryAbsLocation(const QString &argv0)
QString buildRoot() const
ProString first(const ProKey &variableName) const
ProStringList & values(const ProKey &v)
The QRegularExpression class provides pattern matching using regular expressions.
@ InvertedGreedinessOption
QRegularExpressionMatch match(const QString &subject, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
The QRegularExpressionMatch class provides the results of a matching a QRegularExpression against a s...
qsizetype capturedStart(int nth=0) const
qsizetype capturedLength(int nth=0) const
The QString class provides a Unicode character string.
QString right(qsizetype n) const
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLatin1(QByteArrayView ba)
static QString fromLocal8Bit(QByteArrayView ba)
QString mid(qsizetype position, qsizetype n=-1) const
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QStringList class provides a list of strings.
CommandLineParseResult parseCommandLine(QCommandLineParser &parser, DnsQuery *query, QString *errorMessage)
qDeleteAll(list.begin(), list.end())
QCache< int, Employee > cache
[0]
static void const void const char bool unsigned int int const char va_start(ap, message)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
void warn_msg(QMakeWarn type, const char *fmt,...)
void qmakeAddCacheClear(qmakeCacheClearFunc func, void **data)
bool usage(const char *a0)
void debug_msg_internal(int level, const char *fmt,...)
QList< QString > QStringList
QT_BEGIN_INCLUDE_NAMESPACE typedef unsigned char uchar
GLenum GLuint GLenum GLsizei length
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLint level
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const GLchar *const * path
GLsizei const GLchar *const * string
[0]
QFileInfo fi("c:/temp/foo")
[newstuff]
static int cachefile_depth
static QStringList project_files
static bool do_dep_heuristics
static bool do_preprocess
static QStringList project_dirs
static QStringList properties
static EvalHandler evalHandler
static QMakeGlobals * globals
static QStringList cpp_ext
static void prepareProject(const QString &pfile)
static QString pkgcfg_ext
static ProFileCache * proFileCache
static QString fixString(QString string, uchar flags)
static QString cpp_moc_ext
static QMAKE_MODE qmake_mode
@ QMAKE_CMDLINE_SHOW_USAGE
static int init(int argc=0, char **argv=nullptr)
static QMakeParser * parser
@ QMAKE_GENERATE_MAKEFILE
static QString objcpp_ext
static QString output_dir
@ FixPathToLocalSeparators
@ FixPathToTargetSeparators
@ FixPathToNormalSeparators
static bool postProcessProject(QMakeProject *)
static QString libtool_ext
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static QString path(int loc)
static QString rawLocation(int loc, PathGroup group)