summaryrefslogtreecommitdiffstats
path: root/basicsuite/shared/shared.pri
blob: 86bc7de18989aae78a4db2ba7554e73a36ebfb66 (plain)
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
QT += quickcontrols2

#Use only for desktop or if target Qt does not support fontconfg
DEFINES += FONTS_AS_RESOURCES

defineTest(b2qtdemo_deploy_defaults) {
    # Just backward compatibility do nothing
}

# copies the given files to the destination directory
defineTest(copyToDestDir) {
    files = $$1
    dir = $$2

    for(file, files) {
        QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$shell_quote($$file) $$shell_quote($$dir) $$escape_expand(\\n\\t)
    }

    export(QMAKE_POST_LINK)
}

CONFIG(cross_compile) {
    message("Building for target")
    DESTPATH = /data/user/qt/$$TARGET
    target.path = $$DESTPATH
} else {
    message("Building for Desktop")
    DESTPATH = $$OUT_PWD
    target.path = $$DESTPATH
    COPIES += commonFiles content images style
}

# Common fonts if app does not explicitly add it's own
fonts.files += \
    $$PWD/fonts/TitilliumWeb-Black.ttf \
    $$PWD/fonts/TitilliumWeb-Bold.ttf \
    $$PWD/fonts/TitilliumWeb-ExtraLight.ttf \
    $$PWD/fonts/TitilliumWeb-Light.ttf \
    $$PWD/fonts/TitilliumWeb-Regular.ttf \
    $$PWD/fonts/TitilliumWeb-SemiBold.ttf

contains(DEFINES, FONTS_AS_RESOURCES) {
    !contains(DEFINES, USE_APP_FONTS) {
        # Common fonts
        RESOURCES += $$PWD/shared_fonts.qrc
    }

    # Application defined fonts
    APP_FONTS=$${_PRO_FILE_PWD_}/fonts.qrc
    exists($${APP_FONTS}) {
        RESOURCES += $${APP_FONTS}
    }
} else {
    fonts.path = $$DESTPATH/fonts
    INSTALLS += fonts

    CONFIG(cross_compile) {
        QT_FOR_CONFIG += gui-private

        qtConfig(fontconfig) {
            #use fontconfig to provide fonts on target
            fonts.path = /usr/share/fonts/truetype
        }
    } else {
        COPIES += fonts
    }
}

contains(DEFINES, STANDALONE) {
    message("Building as Standalone")
} else {
    message("Building for B2Qt Launcher")
    SOURCES += $$PWD/main.cpp \
               $$PWD/engine.cpp

    HEADERS += $$PWD/engine.h

    commonFiles.files = \
                        $$PWD/SharedMain.qml \
                        # Resides on each application own source directory
                        preview_l.jpg \
                        demo.xml

    commonFiles.path = $$DESTPATH
    OTHER_FILES += $${commonFiles.files}
    INSTALLS += commonFiles
}

# Common for all projects that include this file. Only redefine in your project file
# if different destination folder that default is preferred
content.path = $$DESTPATH
OTHER_FILES += $${content.files}

images.path = $$DESTPATH/images
OTHER_FILES += $${images.files}

style.path = $$DESTPATH/Style
OTHER_FILES += $${style.files}

INSTALLS += target content images style