summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@collabora.co.uk>2011-01-17 13:31:45 +0100
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 12:25:00 +0200
commit00c125e41a815ceecb3f2753e14553ec9f9f778d (patch)
tree132cbed85eaaf3a2a5a835a5ded0999fc70cc21a /mkspecs
parent9d465dd8333bd74f6f8976b76d1c4ccf95ae1586 (diff)
Use packagesExist() macro to bail if a nonexistant package is requested.
This will solve problematic cases with large projects, lots of required packages, and no configure scripts failing to build partway through. Previously, PKGCONFIG processing would error to stdout, but continue the compilation. This should not affect existing code overly much, apart from projects who added nonexistent packages they didn't use to PKGCONFIG (but let's face it, that's a bit of a stupid thing to do.) Task-number: QTBUG-11418 Merge-request: 1022 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/link_pkgconfig.prf4
1 files changed, 4 insertions, 0 deletions
diff --git a/mkspecs/features/link_pkgconfig.prf b/mkspecs/features/link_pkgconfig.prf
index d70e5de104..b972617244 100644
--- a/mkspecs/features/link_pkgconfig.prf
+++ b/mkspecs/features/link_pkgconfig.prf
@@ -1,7 +1,11 @@
# handle pkg-config files
isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config
for(PKGCONFIG_LIB, $$list($$unique(PKGCONFIG))) {
+ # don't proceed if the .pro asks for a package we don't have!
+ !packagesExist($$PKGCONFIG_LIB):error("Package $$PKGCONFIG_LIB not found")
+
QMAKE_CXXFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB)
QMAKE_CFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB)
LIBS += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB)
}
+