avoid using infile() needlessly
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Tue, 21 Feb 2012 20:30:57 +0000 (21:30 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 27 Feb 2012 19:52:45 +0000 (20:52 +0100)
it's rather pointless to first query the variable's presence in the
file. instead, just fetch it and see what is in there.

for this to work cleanly we defer the concatenation of the filename.

Change-Id: I322db8ae897272fae049074d8b7676787286aedd
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
mkspecs/features/qt_config.prf

index 3d0028c..8441728 100644 (file)
@@ -6,9 +6,10 @@ exists($$_QMAKE_CACHE_) {
     QMAKE_EXTRA_MODULE_FORWARDS = $$fromfile($$_QMAKE_CACHE_, QMAKE_EXTRA_MODULE_FORWARDS)
 }
 isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) {
-   !isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE/mkspecs/qconfig.pri
-   else:exists($$_QMAKE_CACHE_):infile($$_QMAKE_CACHE_, QT_BUILD_TREE):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)/mkspecs/qconfig.pri
-   isEmpty(QMAKE_QT_CONFIG):exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri
+   !isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE
+   else:exists($$_QMAKE_CACHE_):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)
+   isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]
+   QMAKE_QT_CONFIG = $$QMAKE_QT_CONFIG/mkspecs/qconfig.pri
 }
 !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
    debug(1, "Cannot load qconfig.pri!")