source: trunk/doc/src/snippets/code/doc_src_deployment.qdoc@ 865

Last change on this file since 865 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

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