2011-10-19 13:36:33 +00:00
|
|
|
PKG_CONFIG = $$pkgConfigExecutable()
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-08-02 14:17:05 +00:00
|
|
|
# qmake supports no empty list elements, so the outer loop is a bit arcane
|
|
|
|
pkgsfx =
|
|
|
|
for(ever) {
|
|
|
|
pkgvar = PKGCONFIG$$pkgsfx
|
|
|
|
libvar = LIBS$$pkgsfx
|
|
|
|
for(PKGCONFIG_LIB, $$list($$unique($$pkgvar))) {
|
|
|
|
# don't proceed if the .pro asks for a package we don't have!
|
2013-12-19 15:13:16 +00:00
|
|
|
!packagesExist($$PKGCONFIG_LIB): error("$$PKGCONFIG_LIB development package not found")
|
2012-08-02 14:17:05 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
$$libvar += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB)
|
|
|
|
}
|
|
|
|
!isEmpty(pkgsfx): break()
|
|
|
|
pkgsfx = _PRIVATE
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|