From 59ee3e5db6cf0b97682cd1b3bc2a6decbca1cb1d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 26 Aug 2013 16:13:54 +0200 Subject: [PATCH] export QT_TOOL_ENV to the tool module pri file fixes "make ts" in qttranslations in a non-installed prefix build. amends 13e01fda1 Change-Id: I2547d825c1c71e42fdacab5edaace67247ef69e7 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 1 + mkspecs/features/qt_tool.prf | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 07821fd09b..31b7607d6e 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -206,6 +206,7 @@ defineTest(qtPrepareTool) { } } } + QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars) !isEmpty(3) { $$1$$3 = $$system_path($$eval($$1)) qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 9a6b9634e0..f0f0fe567b 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -27,9 +27,28 @@ CONFIG += console TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri + vars = binary depends + !isEmpty(QT_TOOL_ENV) { + vars += envvars + module_var_names = + module_var_sets = + for(var, QT_TOOL_ENV) { + vars += env.$${var}.name env.$${var}.value + module_var_names += QT_TOOL.$${MODULE}.env.$${var} + module_var_sets += \ + "QT_TOOL.$${MODULE}.env.$${var}.name = $$val_escape($${var}.name)" \ + "QT_TOOL.$${MODULE}.env.$${var}.value = $$val_escape($${var}.value)" + } + module_envvars = \ + "QT_TOOL.$${MODULE}.envvars = $$module_var_names" \ + $$module_var_sets + } else { + module_envvars = + } TOOL_PRI_CONT = \ "QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ - "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" + "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ + $$module_envvars write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -39,7 +58,7 @@ CONFIG += console unset(added) } include($$TOOL_PRI) - for(var, $$list(binary depends)): \ + for(var, vars): \ cache(QT_TOOL.$${MODULE}.$$var, transient) }