qmake: Expose qmake arguments as QMAKE_ARGS

Allows project files or mkspecs to call qmake recursively using system()
with the right arguments, which we use to fix the ios default_post.prf.

Change-Id: I90d69e2b156bb0f0af1279188b11f81c84c24fb8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-10-23 14:02:59 +02:00 committed by The Qt Project
parent c584f3d9a8
commit 1cdbe4752b
6 changed files with 10 additions and 5 deletions

View File

@ -27,7 +27,11 @@ equals(TEMPLATE, app) {
TARGET_XCODE_PROJECT_DIR = $${TARGET}.xcodeproj
system("cd $$system_quote($$OUT_PWD) && $${QMAKE_QMAKE} $$system_quote($$_PRO_FILE_) -spec macx-xcode")
args =
for(arg, QMAKE_ARGS): \
args += $$system_quote($$arg)
system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode")
# We use xcodebuild to do the actual build, but filter out the verbose
# output that shows all environment variables for each build step.

View File

@ -2261,7 +2261,7 @@ QString MakefileGenerator::buildArgs()
{
QString ret;
foreach (const QString &arg, Option::qmake_args)
foreach (const QString &arg, Option::globals->qmake_args)
ret += " " + escapeFilePath(arg);
return ret;
}

View File

@ -982,6 +982,8 @@ void QMakeEvaluator::loadDefaults()
vars[ProKey("_DATE_")] << ProString(QDateTime::currentDateTime().toString());
if (!m_option->qmake_abslocation.isEmpty())
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 defined(Q_OS_WIN32)
vars[ProKey("QMAKE_HOST.os")] << ProString("Windows");

View File

@ -117,6 +117,7 @@ public:
QProcessEnvironment environment;
#endif
QString qmake_abslocation;
QStringList qmake_args;
QString qmakespec, xqmakespec;
QString user_template, user_template_prefix;

View File

@ -82,7 +82,6 @@ char Option::field_sep;
Option::QMAKE_MODE Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
//all modes
QStringList Option::qmake_args;
int Option::warn_level = WarnLogic | WarnDeprecated;
int Option::debug_level = 0;
QFile Option::output;
@ -436,7 +435,7 @@ Option::init(int argc, char **argv)
return ret;
//return ret == QMAKE_CMDLINE_SHOW_USAGE ? usage(argv[0]) : false;
}
Option::qmake_args = args;
globals->qmake_args = args;
}
globals->commitCommandLineArguments(cmdstate);
globals->debugLevel = Option::debug_level;

View File

@ -178,7 +178,6 @@ struct Option
static QMAKE_MODE qmake_mode;
//all modes
static QStringList qmake_args;
static QFile output;
static QString output_dir;
static int debug_level;