Update copyright headers
[qt:qt.git] / doc / src / snippets / code / doc_src_deployment.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
9 ** You may use this file under the terms of the BSD license as follows:
10 **
11 ** "Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions are
13 ** met:
14 **   * Redistributions of source code must retain the above copyright
15 **     notice, this list of conditions and the following disclaimer.
16 **   * Redistributions in binary form must reproduce the above copyright
17 **     notice, this list of conditions and the following disclaimer in
18 **     the documentation and/or other materials provided with the
19 **     distribution.
20 **   * Neither the name of The Qt Company Ltd nor the names of its
21 **     contributors may be used to endorse or promote products derived
22 **     from this software without specific prior written permission.
23 **
24 **
25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40
41 //! [0]
42 cd /path/to/Qt
43 ./configure -static -prefix /path/to/Qt <other parameters>
44 make sub-src
45 //! [0]
46
47
48 //! [1]
49 cd /path/to/Qt/examples/tools/plugandpaint
50 //! [1]
51
52
53 //! [2]
54 make clean
55 PATH=/path/to/Qt/bin:$PATH
56 export PATH
57 qmake -config release
58 make
59 //! [2]
60
61
62 //! [3]
63 ldd ./application
64 //! [3]
65
66
67 //! [4]
68 cd /path/to/Qt/examples/tools/plugandpaint
69 //! [4]
70
71
72 //! [5]
73 make clean
74 qmake -config release
75 make
76 //! [5]
77
78
79 //! [6]
80 cd ../plugandpaintplugins
81 make clean
82 qmake -config release
83 make
84 //! [6]
85
86
87 //! [7]
88 #!/bin/sh
89 appname=`basename $0 | sed s,\.sh$,,`
90
91 dirname=`dirname $0`
92 tmp="${dirname#?}"
93
94 if [ "${dirname%$tmp}" != "/" ]; then
95 dirname=$PWD/$dirname
96 fi
97 LD_LIBRARY_PATH=$dirname
98 export LD_LIBRARY_PATH
99 $dirname/$appname "$@"
100 //! [7]
101
102
103 //! [10]
104 ldd ./application
105 //! [10]
106
107
108 //! [11]
109 cd C:\path\to\Qt
110 configure -static <any other options you need>
111 //! [11]
112
113
114 //! [12]
115 nmake sub-src
116 //! [12]
117
118
119 //! [13]
120 cd examples\tools\plugandpaint
121 //! [13]
122
123
124 //! [14]
125 nmake clean
126 qmake -config release
127 nmake
128 //! [14]
129
130
131 //! [15]
132 cd examples\tools\plugandpaint
133 //! [15]
134
135
136 //! [16]
137 nmake clean
138 qmake -config release
139 nmake
140 //! [16]
141
142
143 //! [17]
144 cd ..\plugandpaintplugins
145 nmake clean
146 qmake -config release
147 nmake
148 //! [17]
149
150
151 //! [18]
152 plugins\pnp_basictools.dll
153 plugins\pnp_extrafilters.dll
154 //! [18]
155
156
157 //! [20]
158 embed_manifest_dll
159 embed_manifest_exe
160 //! [20]
161
162
163 //! [21]
164 CONFIG += embed_manifest_exe
165 //! [21]
166
167
168 //! [22]
169 <Visual Studio Install Path>\VC\redist\<Architecture>\Microsoft.VC80.CRT
170 //! [22]
171
172
173 //! [23]
174 CONFIG-=embed_manifest_dll
175 //! [23]
176
177
178 //! [24]
179 depends <application executable>
180 //! [24]
181
182
183 //! [25]
184 C:<path to Qt>\plugins
185 //! [25]
186
187
188 //! [26]
189 CONFIG-=app_bundle
190 //! [26]
191
192
193 //! [27]
194 cd /path/to/Qt
195 ./configure -static <other parameters>
196 make sub-src
197 //! [27]
198
199
200 //! [28]
201 cd /path/to/Qt/examples/tools/plugandpaint
202 //! [28]
203
204
205 //! [29]
206 make clean
207 qmake -config release
208 make
209 //! [29]
210
211
212 //! [30]
213 otool -L plugandpaint.app/Contents/MacOs/plugandpaint
214 //! [30]
215
216
217 //! [31]
218 plugandpaint.app/Contents/MacOS/plugandpaint:
219 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
220         (compatibility version 2.0.0, current version 128.0.0)
221 /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
222         (compatibility version 1.0.0, current version 10.0.0)
223 /usr/lib/libz.1.dylib
224         (compatibility version 1.0.0, current version 1.2.3)
225 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
226         (compatibility version 1.0.0, current version 22.0.0)
227 /usr/lib/libstdc++.6.dylib
228         (compatibility version 7.0.0, current version 7.3.0)
229 /usr/lib/libgcc_s.1.dylib
230         (compatibility version 1.0.0, current version 1.0.0)
231 /usr/lib/libmx.A.dylib
232         (compatibility version 1.0.0, current version 92.0.0)
233 /usr/lib/libSystem.B.dylib
234         (compatibility version 1.0.0, current version 88.0.0)
235 //! [31]
236
237
238 //! [32]
239 -lQtGui
240 //! [32]
241
242
243 //! [33]
244 /where/static/qt/lib/is/libQtGui.a
245 //! [33]
246
247
248 //! [34]
249 cd /path/to/Qt/examples/tools/plugandpaint
250 //! [34]
251
252
253 //! [35]
254 make clean
255 qmake -config release
256 make
257 //! [35]
258
259
260 //! [36]
261 cd ../plugandpaintplugins
262 make clean
263 qmake -config release
264 make
265 //! [36]
266
267
268 //! [37]
269 otool -L QtGui.framework/QtGui
270 //! [37]
271
272
273 //! [38]
274 QtGui.framework/QtGui:
275 /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
276         (compatibility version 4.0.0, current version 4.0.1)
277 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
278         (compatibility version 2.0.0, current version 128.0.0)
279 /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
280         (compatibility version 1.0.0, current version 10.0.0)
281 /path/to/Qt/QtCore.framework/Versions/4.0/QtCore
282         (compatibility version 4.0.0, current version 4.0.1)
283 /usr/lib/libz.1.dylib
284         (compatibility version 1.0.0, current version 1.2.3)
285 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
286         (compatibility version 1.0.0, current version 22.0.0)
287 /usr/lib/libstdc++.6.dylib
288         (compatibility version 7.0.0, current version 7.3.0)
289 /usr/lib/libgcc_s.1.dylib
290         (compatibility version 1.0.0, current version 1.0.0)
291 /usr/lib/libmx.A.dylib
292         (compatibility version 1.0.0, current version 92.0.0)
293 /usr/lib/libSystem.B.dylib
294         (compatibility version 1.0.0, current version 88.0.0)
295 //! [38]
296
297
298 //! [39]
299 mkdir plugandpaint.app/Contents/Frameworks
300 cp -R /path/to/Qt/lib/QtCore.framework
301         plugandpaint.app/Contents/Frameworks
302 cp -R /path/to/Qt/lib/QtGui.framework
303        plugandpaint.app/Contents/Frameworks
304 //! [39]
305
306
307 //! [40]
308 install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
309        plugandpaint.app/Contents/Frameworks/QtCore.framework/Versions/4.0/QtCore
310 install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
311        plugandpaint.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui
312 //! [40]
313
314
315 //! [41]
316 install_name_tool -change path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
317         @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
318         plugandpaint.app/Contents/MacOs/plugandpaint
319 install_name_tool -change path/to/qt/lib/QtGui.framework/Versions/4.0/QtGui
320         @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
321         plugandpaint.app/Contents/MacOs/plugandpaint
322 //! [41]
323
324
325 //! [42]
326 install_name_tool -change path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
327         @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
328         plugandpaint.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui
329 //! [42]
330
331
332 //! [43]
333 mv plugins plugandpaint.app/Contents
334 //! [43]
335
336
337 //! [44]
338 libpnp_basictools.dylib:
339 libpnp_basictools.dylib
340        (compatibility version 0.0.0, current version 0.0.0)
341 /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
342        (compatibility version 4.0.0, current version 4.0.1)
343 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
344        (compatibility version 2.0.0, current version 128.0.0)
345 /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
346        (compatibility version 1.0.0, current version 10.0.0)
347 /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
348        (compatibility version 4.0.0, current version 4.0.1)
349 /usr/lib/libz.1.dylib
350        (compatibility version 1.0.0, current version 1.2.3)
351 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
352        (compatibility version 1.0.0, current version 22.0.0)
353 /usr/lib/libstdc++.6.dylib
354        (compatibility version 7.0.0, current version 7.3.0)
355 /usr/lib/libgcc_s.1.dylib
356        (compatibility version 1.0.0, current version 1.0.0)
357 /usr/lib/libmx.A.dylib
358        (compatibility version 1.0.0, current version 92.0.0)
359 /usr/lib/libSystem.B.dylib
360        (compatibility version 1.0.0, current version 88.0.0)
361 //! [44]
362
363
364 //! [45]
365 install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
366         @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
367         plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
368 install_name_tool -change /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
369         @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
370         plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
371 //! [45]
372
373
374 //! [46]
375 #elif defined(Q_OS_MAC)
376 if (pluginsDir.dirName() == "MacOS") {
377     pluginsDir.cdUp();
378 }
379 #endif
380 //! [46]
381
382
383 //! [47]
384 cp -R /path/to/Qt/plugins/imageformats
385         pluginandpaint.app/Contents/plugins
386 //! [47]
387
388
389 //! [48]
390 install_name_tool -change /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
391         @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
392         plugandpaint.app/Contents/plugins/imageformats/libqjpeg.dylib
393 install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
394         @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
395         plugandpaint.app/Contents/plugins/imageformats/libqjpeg.dylib
396 //! [48]
397
398
399 //! [50]
400 otool -L MyApp.app/Contents/MacOS/MyApp
401 //! [50]
402
403
404 //! [51]
405 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
406 //! [51]
407
408 //! [51a]
409 install_name_tool -change /System/Library/Frameworks/CoreVideo.framework/
410 Versions/A/CoreVideo /System/Library/Frameworks/QuartzCore.framework/
411 Versions/A/QuartzCore libphonon_qt7.dylib 
412 //! [51a]
413
414 //! [51b]
415 ./CONFIGURE - SDK MacOSX10.4u.sdk
416 //! [51b]
417
418 //! [52]
419 ./configure (other arguments) -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk
420 //! [52]
421
422
423 //! [53]
424 QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
425 CONFIG+=x86 ppc
426 //! [53]
427
428
429 //! [54]
430 qApp->addLibraryPath("C:/customPath/plugins");
431 //! [54]
432
433 //! [55]
434 cd examples\widgets\wiggly
435 //! [55]
436
437 //! [56]
438 vendorinfo = \
439     "%{\"Example Localized Vendor\"}" \
440     ":\"Example Vendor\""
441
442 my_deployment.pkg_prerules = vendorinfo
443 DEPLOYMENT += my_deployment
444 //! [56]
445
446 //! [57]
447 supported_platforms = \
448     "; This demo only supports S60 5.0" \
449     "[0x1028315F],0,0,0,{\"S60ProductID\"}"
450
451 default_deployment.pkg_prerules -= pkg_platform_dependencies
452 my_deployment.pkg_prerules += supported_platforms
453 DEPLOYMENT += my_deployment
454 //! [57]
455
456 //! [58]
457 qmake
458 make release-gcce
459 //! [58]
460
461 //! [59]
462 make installer_sis
463 //! [59]