~ubuntu-branches/ubuntu/wily/qtbase-opensource-src/wily

« back to all changes in this revision

Viewing changes to mkspecs/features/link_pkgconfig.prf

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 12:46:17 UTC
  • Revision ID: package-import@ubuntu.com-20130205124617-c8jouts182j002fx
Tags: upstream-5.0.1+dfsg
ImportĀ upstreamĀ versionĀ 5.0.1+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PKG_CONFIG = $$pkgConfigExecutable()
 
2
 
 
3
# qmake supports no empty list elements, so the outer loop is a bit arcane
 
4
pkgsfx =
 
5
for(ever) {
 
6
    pkgvar = PKGCONFIG$$pkgsfx
 
7
    libvar = LIBS$$pkgsfx
 
8
    for(PKGCONFIG_LIB, $$list($$unique($$pkgvar))) {
 
9
        # don't proceed if the .pro asks for a package we don't have!
 
10
        !packagesExist($$PKGCONFIG_LIB):error("Package $$PKGCONFIG_LIB not found")
 
11
 
 
12
        PKGCONFIG_CFLAGS = $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB)
 
13
 
 
14
        PKGCONFIG_INCLUDEPATH = $$find(PKGCONFIG_CFLAGS, ^-I.*)
 
15
        PKGCONFIG_INCLUDEPATH ~= s/^-I(.*)/\\1/g
 
16
 
 
17
        PKGCONFIG_DEFINES = $$find(PKGCONFIG_CFLAGS, ^-D.*)
 
18
        PKGCONFIG_DEFINES ~= s/^-D(.*)/\\1/g
 
19
 
 
20
        PKGCONFIG_CFLAGS ~= s/^-[ID].*//g
 
21
 
 
22
        INCLUDEPATH *= $$PKGCONFIG_INCLUDEPATH
 
23
        DEFINES *= $$PKGCONFIG_DEFINES
 
24
 
 
25
        QMAKE_CXXFLAGS += $$PKGCONFIG_CFLAGS
 
26
        QMAKE_CFLAGS += $$PKGCONFIG_CFLAGS
 
27
        $$libvar += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB)
 
28
    }
 
29
    !isEmpty(pkgsfx): break()
 
30
    pkgsfx = _PRIVATE
 
31
}
 
32