Commit 69088860 authored by David Schulz's avatar David Schulz Committed by Oswald Buddenhagen

QMake: Add option to set qt.conf file

Change-Id: Ie5db11892ccf2d357773a4db6a0464bf27be9a26
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
(cherry picked from qtbase/dbf1c2eb9f4e1feb24a58699b7b550016802e386)
Reviewed-by: Jake Petroules's avatarJake Petroules <jake.petroules@qt.io>
parent fb9e43ba
......@@ -1006,6 +1006,8 @@ void QMakeEvaluator::loadDefaults()
vars[ProKey("QMAKE_QMAKE")] << ProString(m_option->qmake_abslocation);
if (!m_option->qmake_args.isEmpty())
vars[ProKey("QMAKE_ARGS")] = ProStringList(m_option->qmake_args);
if (!m_option->qtconf.isEmpty())
vars[ProKey("QMAKE_QTCONF")] = ProString(m_option->qtconf);
vars[ProKey("QMAKE_HOST.cpu_count")] = ProString(QString::number(idealThreadCount()));
#if defined(Q_OS_WIN32)
vars[ProKey("QMAKE_HOST.os")] << ProString("Windows");
......
......@@ -103,7 +103,7 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s
QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
QMakeCmdLineParserState &state, QStringList &args, int *pos)
{
enum { ArgNone, ArgConfig, ArgSpec, ArgXSpec, ArgTmpl, ArgTmplPfx, ArgCache } argState = ArgNone;
enum { ArgNone, ArgConfig, ArgSpec, ArgXSpec, ArgTmpl, ArgTmplPfx, ArgCache, ArgQtConf } argState = ArgNone;
for (; *pos < args.count(); (*pos)++) {
QString arg = args.at(*pos);
switch (argState) {
......@@ -128,6 +128,9 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
case ArgCache:
cachefile = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg));
break;
case ArgQtConf:
qtconf = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg));
break;
default:
if (arg.startsWith(QLatin1Char('-'))) {
if (arg == QLatin1String("-after"))
......@@ -138,6 +141,8 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
do_cache = false;
else if (arg == QLatin1String("-cache"))
argState = ArgCache;
else if (arg == QLatin1String("-qtconf"))
argState = ArgQtConf;
else if (arg == QLatin1String("-platform") || arg == QLatin1String("-spec"))
argState = ArgSpec;
else if (arg == QLatin1String("-xplatform") || arg == QLatin1String("-xspec"))
......
......@@ -103,6 +103,7 @@ public:
QString qmake_abslocation;
QStringList qmake_args;
QString qtconf;
QString qmakespec, xqmakespec;
QString user_template, user_template_prefix;
QString precmds, postcmds;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment