summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-09-13 18:13:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-18 00:59:08 +0200
commit321687f03b25e71ee7be7bed35a8e615dcb7f381 (patch)
treef30814abdcc809f46ac2f6d5272f39ca67132264 /mkspecs
parentfb8a6297f416e0367bbe0011e9b0ac52a6d7748d (diff)
factor out qtAddToolEnv()
so it's available for other users as well Change-Id: I2d5a14ae427575c07321ac532b13ee03308b837f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/qt_functions.prf20
-rw-r--r--mkspecs/features/qt_tool.prf17
2 files changed, 21 insertions, 16 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index e40e56df20..58c35ddd41 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -184,6 +184,26 @@ defineTest(qtPrepareTool) {
export($$1)
}
+defineTest(qtAddToolEnv) {
+ for(env, 2) {
+ value = $$eval($${env}.value)
+ !isEmpty(value) {
+ name = $$eval($${env}.name)
+ equals(QMAKE_DIR_SEP, /) {
+ contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
+ else: infix =
+ $$1 = "$$name=$$join(value, :)$$infix $$eval($$1)"
+ } else {
+ # Escape closing parens when expanding the variable, otherwise cmd confuses itself.
+ contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
+ else: infix =
+ $$1 = "(set $$name=$$join(value, ;)$$infix) & $$eval($$1)"
+ }
+ }
+ }
+ export($$1)
+}
+
defineReplace(pkgConfigExecutable) {
isEmpty(PKG_CONFIG) {
PKG_CONFIG = pkg-config
diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf
index 758d52444c..d17e06a7fa 100644
--- a/mkspecs/features/qt_tool.prf
+++ b/mkspecs/features/qt_tool.prf
@@ -64,22 +64,7 @@ INSTALLS += target
QT_TOOL_ENV += deppath pluginpath
}
- for(env, QT_TOOL_ENV) {
- value = $$eval($${env}.value)
- !isEmpty(value) {
- name = $$eval($${env}.name)
- equals(QMAKE_DIR_SEP, /) {
- contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
- else: infix =
- cmd = "$$name=$$join(value, :)$$infix $$cmd"
- } else {
- # Escape closing parens when expanding the variable, otherwise cmd confuses itself.
- contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
- else: infix =
- cmd = "(set $$name=$$join(value, ;)$$infix) & $$cmd"
- }
- }
- }
+ qtAddToolEnv(cmd, $$QT_TOOL_ENV)
TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_$${MODULE}.pri