packagesExist(): always return false if QT_CONFIG contains no-pkg-config
authorMilian Wolff <milian.wolff@kdab.com>
Mon, 19 Nov 2012 14:53:57 +0000 (15:53 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 21 Nov 2012 15:36:50 +0000 (16:36 +0100)
On QNX e.g. you'll end up with a Qt configured without pkg-config support
by default. Once you try to compile e.g. QtWebKit which contains a check
like packagesExist(libudev) the system pkg-config (see default branch
of pkgConfigExecutable) will be called without any special config sysroot
or libdir. Thus libudev will be found in your system host, even though
it is not available for the cross compile target. This leads to compile
errors as described in https://bugs.webkit.org/show_bug.cgi?id=98032 .

Change-Id: If1474cb3b3f3b71fad7269e4aedd4e10f70a9b2a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
mkspecs/features/qt_functions.prf

index 2998bb9..ac3bdac 100644 (file)
@@ -280,10 +280,11 @@ defineReplace(pkgConfigExecutable) {
 }
 
 defineTest(packagesExist) {
+    contains(QT_CONFIG, no-pkg-config):return(false)
+
     # this can't be done in global scope here because qt_functions is loaded
     # before the .pro is parsed, so if the .pro set PKG_CONFIG, we wouldn't know it
     # yet. oops.
-
     pkg_config = $$pkgConfigExecutable()
 
     for(package, ARGS) {