qt5base-lts/mkspecs/features/link_pkgconfig.prf
Oswald Buddenhagen 183b862fe0 make the pkg-config error message more precise
while the meaning of the error message is actually pretty obvious from
the context, some people apparently expect an equivalence with their
package manager's terminology.

Change-Id: Ie7a31887bf5086e5d1d7de7e339a6d08571a4d01
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-07 19:45:15 +01:00

33 lines
1.0 KiB
Plaintext

PKG_CONFIG = $$pkgConfigExecutable()
# 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!
!packagesExist($$PKGCONFIG_LIB): error("$$PKGCONFIG_LIB development package not found")
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
}