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 <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-08-26 16:13:54 +02:00 committed by The Qt Project
parent 78d7192338
commit 59ee3e5db6
2 changed files with 22 additions and 2 deletions

View File

@ -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)

View File

@ -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)
}