File: qt_example_installs.prf

package info (click to toggle)
qtbase-opensource-src 5.3.2%2Bdfsg-4%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 272,196 kB
  • ctags: 229,359
  • sloc: cpp: 1,623,111; ansic: 386,069; xml: 101,194; sh: 16,504; python: 9,156; java: 4,681; asm: 4,531; perl: 2,392; yacc: 1,926; lex: 970; makefile: 498; awk: 142; objc: 70; sed: 3
file content (103 lines) | stat: -rw-r--r-- 3,337 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
#  W A R N I N G
#  -------------
#
# This file is not part of the Qt API.  It exists purely as an
# implementation detail.  It may change from version to version
# without notice, or even be removed.
#
# We mean it.
#

defineTest(addInstallFiles) {
    for(sf, 2) {
        sf = $$relative_path($$sf, $$_PRO_FILE_PWD_)
        contains(sf, \\..*) {
            check_examples: message("Notice: $$_PRO_FILE_ refers to $$sf")
        } else {
            sfp = $$replace(sf, /.*, )
            !equals(sfp, $$sf): \
                $$1 *= $$sfp
            else: \
                $$1 += $$sf
        }
    }
    export($$1)
}

probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
!isEmpty(probase):!contains(probase, ^\\..*):!isEmpty(_QMAKE_CACHE_) {
    for(ex, EXAMPLE_FILES): \
        sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
    for(res, RESOURCES) {
        rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
        for(rline, rfile) {
            resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
            !equals(resrc, $$rline): \
                sourcefiles += $$resrc
        }
    }
    for(res, RC_FILE) {
        rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
        for(rline, rfile) {
            resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
            !equals(resrc, $$rline): \
                sourcefiles += $$resrc
        }
    }
    extras = \
        $$_PRO_FILE_PWD_/README \
        $$files($$_PRO_FILE_PWD_/*.pri) \
        $$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
        $$replace(_PRO_FILE_, \\.pro$, .json) \
        $$replace(_PRO_FILE_, \\.pro$, .inf)
    for(extra, extras): \
        exists($$extra): \
            sourcefiles += $$extra

    # Just for Qt Creator
    OTHER_FILES += $$sourcefiles

    sourcefiles += \
        $$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
        $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
        $$DBUS_ADAPTORS $$DBUS_INTERFACES
    addInstallFiles(sources.files, $$sourcefiles)
    sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
    INSTALLS += sources

    check_examples {
        srcfiles = $$sources.files
        for(inst, INSTALLS): \
            !equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \
                for(file, $${inst}.files): \
                    instfiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_))
        addInstallFiles(srcfiles, $$instfiles)

        thefiles = $$files($$_PRO_FILE_PWD_/*)
        for(i, thefiles): \
            allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_)
        for(i, srcfiles): \
            allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_)
        for(i, SUBDIRS) {
            sd = $$eval($${i}.file)
            !isEmpty(sd) {
                sd ~= s,/.*,,
            } else {
                sd = $$eval($${i}.subdir)
                isEmpty(sd): sd = $$i
            }
            allfiles -= $$sd
        }
        allfiles -= doc
        !isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
    }

    !equals(TEMPLATE, subdirs):!compile_examples {
        TEMPLATE = aux
        CONFIG -= have_target qt staticlib dll
        SOURCES =
        OBJECTIVE_SOURCES =
        INSTALLS -= target
    }
}