factor out qtAddToolEnv()
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Thu, 13 Sep 2012 16:13:13 +0000 (18:13 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 17 Sep 2012 22:59:08 +0000 (00:59 +0200)
so it's available for other users as well

Change-Id: I2d5a14ae427575c07321ac532b13ee03308b837f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
mkspecs/features/qt_functions.prf
mkspecs/features/qt_tool.prf

index e40e56d..58c35dd 100644 (file)
@@ -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
index 758d524..d17e06a 100644 (file)
@@ -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