diff options
author | Jan Arne Petersen <jpetersen@openismus.com> | 2011-09-07 19:38:21 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-09-07 19:38:45 (GMT) |
commit | 2a1e82452a192c88bcf0250f5976492f6dc3b65f (patch) | |
tree | 2c6e4414fb0df477f55d2d56023ba8ca048e4f20 /mkspecs | |
parent | 270c20490813fa943b4fbf0feb1aecb98f0b19ba (diff) | |
download | Qt-2a1e82452a192c88bcf0250f5976492f6dc3b65f.zip Qt-2a1e82452a192c88bcf0250f5976492f6dc3b65f.tar.gz Qt-2a1e82452a192c88bcf0250f5976492f6dc3b65f.tar.bz2 |
Split CFLAGS from pkg-config properly
Add support for DEFINES and INCLUDEPATH to link_pkgconfig so moc uses
the cflags properly.
Task-number: QTBUG-19922
Merge-request: 2674
Reviewed-by: ossi
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/link_pkgconfig.prf | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mkspecs/features/link_pkgconfig.prf b/mkspecs/features/link_pkgconfig.prf index a3dbd1f..91683f6 100644 --- a/mkspecs/features/link_pkgconfig.prf +++ b/mkspecs/features/link_pkgconfig.prf @@ -5,8 +5,21 @@ 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) + PKGCONFIG_CFLAGS = $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB) + + PKGCONFIG_INCLUDEPATH = $$find(PKGCONFIG_CFLAGS, ^-I.*) + PKGCONFIG_INCLUDEPATH ~= s/^-I(.*)/\\1/g + + PKGCONFIG_DEFINES = $$find(PKGCONFIG_CFLAGS, ^-D.*) + PKGCONFIG_DEFINES ~= s/^-D(.*)/\\1/g + + PKGCONFIG_CFLAGS ~= s/^-[ID].*//g + + INCLUDEPATH *= $$PKGCONFIG_INCLUDEPATH + DEFINES *= $$PKGCONFIG_DEFINES + + QMAKE_CXXFLAGS += $$PKGCONFIG_CFLAGS + QMAKE_CFLAGS += $$PKGCONFIG_CFLAGS LIBS += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB) } |