summaryrefslogtreecommitdiffstats
path: root/pkg.pri
blob: 0f8f50f1ec8fcfc0d49a084b01be330a8611cc52 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Config for making example and demo apps packageable

# Note that the paths here all assumed the including .pro file
# is exactly 3 levels of directory tree below the root

qtc_harmattan {
    CONFIG += maemo
    CONFIG += package
    QMAKE_CXXFLAGS += -Wno-psabi
    # The Qt SDK / Qt Creator harmattan integration needs some special treatment
    QT3D_INSTALL_BINS = /usr/bin
    QT3D_INSTALL_LIBS = /usr/lib
    QT3D_INSTALL_PLUGINS = /usr/lib/qt4/plugins
    QT3D_INSTALL_IMPORTS = /usr/lib/qt4/imports
    QT3D_INSTALL_DATA = /usr/share/qt4
    QT3D_INSTALL_HEADERS = /usr/include/qt4
} else {
    QT3D_INSTALL_BINS = $$[QT_INSTALL_BINS]
    QT3D_INSTALL_LIBS = $$[QT_INSTALL_LIBS]
    QT3D_INSTALL_PLUGINS = $$[QT_INSTALL_PLUGINS]
    QT3D_INSTALL_IMPORTS = $$[QT_INSTALL_IMPORTS]
    QT3D_INSTALL_DATA = $$[QT_INSTALL_DATA]
    QT3D_INSTALL_HEADERS = $$[QT_INSTALL_HEADERS]
}

qt3dquick_deploy_pkg {
    CONFIG += qt3d_deploy_pkg

    package {
        macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
            LIBS += -framework Qt3DQuick -F../../../src/quick3d
            INCLUDEPATH += ../../../src/quick3d/Qt3DQuick.framework/Versions/1/Headers
        } else {
            win32 {
                CONFIG(debug, debug|release) {
                    TARGET = $$member(TARGET, 0)d
                    LIBS += ..\\..\\..\\src\\quick3d\\debug\\Qt3DQuickd.lib
                } else {
                    LIBS += ..\\..\\..\\src\\quick3d\\release\\Qt3DQuick.lib
                }
            } else {
                LIBS += -L../../../src/quick3d -lQt3DQuick
            }
            INCLUDEPATH += ../../../include/Qt3DQuick
        }
        QT += declarative opengl

        maemo: icons.files = qtquick3d.png
    } else {
        CONFIG += qt3dquick
    }
}

qt3d_deploy_pkg {
    package {
        macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
            LIBS += -framework Qt3D -F../../../src/threed
            INCLUDEPATH += ../../../src/threed/Qt3D.framework/Versions/1/Headers
        } else {
            win32 {
                CONFIG(debug, debug|release) {
                    TARGET = $$member(TARGET, 0)d
                    LIBS += ..\\..\\..\\src\\threed\\debug\\Qt3Dd.lib
                } else {
                    LIBS += ..\\..\\..\\src\\threed\\release\\Qt3D.lib
                }
            } else {
                LIBS += -L../../../src/threed -lQt3D
            }
            INCLUDEPATH += ../../../include/Qt3D
        }
        QT += opengl

        !qt3dquick_deploy_pkg: maemo: icons.files = qt3d.png
    } else {
        CONFIG += qt3d
    }
}

contains(TEMPLATE, app) {
    package  {
        maemo {
            applnk.files = $${TARGET}.desktop
            applnk.path = /usr/share/applications

            # icons.files is set by qt3dquick_pkg_dep.pri or qt3d_pkg_dep.pri
            icons.path = /usr/share/icons/hicolor/80x80/apps
            INSTALLS += icons applnk

            target.path += $$QT3D_INSTALL_BINS
            INSTALLS += target
        } else {
            mt {
                applnk.files = info.json
                applnk.path = /opt/mt/applications/$${TARGET}

                # icons.files is set by qt3dquick_pkg_dep.pri or qt3d_pkg_dep.pri
                icons.path = /opt/mt/applications/$${TARGET}
                INSTALLS += icons applnk
                target.path += /opt/mt/applications/$${TARGET}
                INSTALLS += target

                DEFINES += QT3D_USE_OPT=$${TARGET}
            } else {
                target.path += $$QT3D_INSTALL_BINS
                INSTALLS += target
            }
        }
    } else {
        DESTDIR = ../../../bin
    }
    symbian {
        vendorinfo = \
         "%{\"Nokia\"}" \
         ":\"Nokia\""

        my_deployment.pkg_prerules = vendorinfo
        DEPLOYMENT += my_deployment

        qt3dquick_deploy_pkg {
            ICON = ../qtquick3d.svg
        } else {
            ICON = ../qt3d.svg
        }
    }
}

qt3d_deploy_qml {
    # The final TARGET_DIR must match one of the cases that qmlres.h checks
    # in q_get_qmldir() for a given platform in order for our examples to find
    # their qml files and other assets
    mt {
        TARGET_DIR = /opt/mt/applications/$$TARGET
    } else: maemo {
        TARGET_DIR = $$QT3D_INSTALL_DATA/quick3d/examples/$$TARGET
    } else {
        TARGET_DIR = $$QT3D_INSTALL_DATA/quick3d/resources/examples/$$TARGET
    }
    symbian {
        TARGET_DIR = .
    } else: macx {
        TARGET_DIR = .
    } else {
        !package {
            TARGET_DIR = ../../../bin/resources/examples/$$TARGET
        }
    }
    for(dir, INSTALL_DIRS) {
        di.source = $${dir}
        di.target = $$TARGET_DIR
        DEPLOYMENTFOLDERS += di
    }
}

# The following code was generated by the Qt Quick Application wizard of Qt Creator.
# The file it was contained in was qmlapplicationviewer.pri, if necessary it should
# be possible to simply cut & paste the code straight out of the latest version to
# update it.
#
# The only changes has been to comment out the installPrexfix line below, this
# will probably be necessary to replicate when replacing.
#
defineTest(qtcAddDeployment) {
    for(deploymentfolder, DEPLOYMENTFOLDERS) {
        item = item$${deploymentfolder}
        itemsources = $${item}.sources
        $$itemsources = $$eval($${deploymentfolder}.source)
        itempath = $${item}.path
        $$itempath= $$eval($${deploymentfolder}.target)
        export($$itemsources)
        export($$itempath)
        DEPLOYMENT += $$item
    }

    MAINPROFILEPWD = $$PWD

    symbian {
        isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
        isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
    } else:win32 {
        copyCommand =
        !package {
            for(deploymentfolder, DEPLOYMENTFOLDERS) {
                source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
                source = $$replace(source, /, \\)
                sourcePathSegments = $$split(source, \\)
                target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
                target = $$replace(target, /, \\)
                !isEqual(source,$$target) {
                    !isEmpty(copyCommand):copyCommand += &&
                    isEqual(QMAKE_DIR_SEP, \\) {
                        copyCommand += $$QMAKE_COPY_DIR \"$$source\" \"$$target\"
                    } else {
                        source = $$replace(source, \\\\, /)
                        target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
                        target = $$replace(target, \\\\, /)
                        copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
                    }
                }
            }
            !isEmpty(copyCommand) {
                copyCommand = @echo Copying application data... && $$copyCommand
                copydeploymentfolders.commands = $$copyCommand
                first.depends = $(first) copydeploymentfolders
                export(first.depends)
                export(copydeploymentfolders.commands)
                QMAKE_EXTRA_TARGETS += first copydeploymentfolders
            }
        }
        for(deploymentfolder, DEPLOYMENTFOLDERS) {
            item = item$${deploymentfolder}
            itemfiles = $${item}.files
            $$itemfiles = $$eval($${deploymentfolder}.source)
            itempath = $${item}.path
            $$itempath = $$eval($${deploymentfolder}.target)
            export($$itemfiles)
            export($$itempath)
            INSTALLS += $$item
        }
    } else:unix {
        maemo5 {
            desktopfile.files = $${TARGET}.desktop
            desktopfile.path = /usr/share/applications/hildon
            icon.files = $${TARGET}64.png
            icon.path = /usr/share/icons/hicolor/64x64/apps
        } else {
            desktopfile.files = $${TARGET}_harmattan.desktop
            desktopfile.path = /usr/share/applications
            icon.files = $${TARGET}80.png
            icon.path = /usr/share/icons/hicolor/80x80/apps
            copyCommand =
            for(deploymentfolder, DEPLOYMENTFOLDERS) {
                source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
                source = $$replace(source, \\\\, /)
                macx {
                    target = $$DESTDIR/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
                } else {
                    target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
                }
                target = $$replace(target, \\\\, /)
                sourcePathSegments = $$split(source, /)
                targetFullPath = $$target/$$last(sourcePathSegments)
                !isEqual(source,$$targetFullPath) {
                    !isEmpty(copyCommand):copyCommand += &&
                    copyCommand += $(MKDIR) \"$$target\"
                    copyCommand += && $(COPY_DIR) -v \"$$source\" \"$$target\"
                }
            }
            !isEmpty(copyCommand) {
                copyCommand = @echo Copying application data... && $$copyCommand
                copydeploymentfolders.commands = $$copyCommand
                first.depends = $(first) copydeploymentfolders
                export(first.depends)
                export(copydeploymentfolders.commands)
                QMAKE_EXTRA_TARGETS += first copydeploymentfolders
            }
        }
        for(deploymentfolder, DEPLOYMENTFOLDERS) {
            item = item$${deploymentfolder}
            itemfiles = $${item}.files
            $$itemfiles = $$eval($${deploymentfolder}.source)
            itempath = $${item}.path
            $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
            export($$itemfiles)
            export($$itempath)
            INSTALLS += $$item
        }
        package {
            export(icon.files)
            export(icon.path)
            export(desktopfile.files)
            export(desktopfile.path)
            export(target.path)
            INSTALLS += desktopfile icon target
        }
    }

    export (ICON)
    export (INSTALLS)
    export (DEPLOYMENT)
    export (TARGET.EPOCHEAPSIZE)
    export (TARGET.CAPABILITY)
    export (LIBS)
    export (QMAKE_EXTRA_TARGETS)
}