|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the documentation of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 //! [0] |
|
43 make all |
|
44 //! [0] |
|
45 |
|
46 |
|
47 //! [1] |
|
48 CONFIG += qt thread debug |
|
49 //! [1] |
|
50 |
|
51 |
|
52 //! [2] |
|
53 CONFIG += qt |
|
54 QT += network xml |
|
55 //! [2] |
|
56 |
|
57 |
|
58 //! [3] |
|
59 QT = network xml # This will omit the core and gui modules. |
|
60 //! [3] |
|
61 |
|
62 |
|
63 //! [4] |
|
64 QT -= gui # Only the core module is used. |
|
65 //! [4] |
|
66 |
|
67 |
|
68 //! [5] |
|
69 CONFIG += link_pkgconfig |
|
70 PKGCONFIG += ogg dbus-1 |
|
71 //! [5] |
|
72 |
|
73 |
|
74 //! [6] |
|
75 LIBS += -L/usr/local/lib -lmath |
|
76 //! [6] |
|
77 |
|
78 |
|
79 //! [7] |
|
80 INCLUDEPATH = c:/msdev/include d:/stl/include |
|
81 //! [7] |
|
82 |
|
83 |
|
84 //! [8] |
|
85 qmake [mode] [options] files |
|
86 //! [8] |
|
87 |
|
88 |
|
89 //! [9] |
|
90 qmake -makefile [options] files |
|
91 //! [9] |
|
92 |
|
93 |
|
94 //! [10] |
|
95 qmake -makefile -unix -o Makefile "CONFIG+=test" test.pro |
|
96 //! [10] |
|
97 |
|
98 |
|
99 //! [11] |
|
100 qmake "CONFIG+=test" test.pro |
|
101 //! [11] |
|
102 |
|
103 |
|
104 //! [12] |
|
105 qmake -project [options] files |
|
106 //! [12] |
|
107 |
|
108 |
|
109 //! [13] |
|
110 qmake -spec macx-g++ |
|
111 //! [13] |
|
112 |
|
113 |
|
114 //! [14] |
|
115 QMAKE_LFLAGS += -F/path/to/framework/directory/ |
|
116 //! [14] |
|
117 |
|
118 |
|
119 //! [15] |
|
120 LIBS += -framework TheFramework |
|
121 //! [15] |
|
122 |
|
123 |
|
124 //! [16] |
|
125 TEMPLATE = lib |
|
126 CONFIG += lib_bundle |
|
127 //! [16] |
|
128 |
|
129 |
|
130 //! [17] |
|
131 FRAMEWORK_HEADERS.version = Versions |
|
132 FRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.h |
|
133 FRAMEWORK_HEADERS.path = Headers |
|
134 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS |
|
135 //! [17] |
|
136 |
|
137 |
|
138 //! [18] |
|
139 CONFIG += x86 ppc |
|
140 //! [18] |
|
141 |
|
142 |
|
143 //! [19] |
|
144 qmake -spec macx-xcode project.pro |
|
145 //! [19] |
|
146 |
|
147 |
|
148 //! [20] |
|
149 qmake -tp vc |
|
150 //! [20] |
|
151 |
|
152 |
|
153 //! [21] |
|
154 qmake -tp vc -r |
|
155 //! [21] |
|
156 |
|
157 |
|
158 //! [22] |
|
159 CONFIG -= embed_manifest_exe |
|
160 //! [22] |
|
161 |
|
162 |
|
163 //! [23] |
|
164 CONFIG -= embed_manifest_dll |
|
165 //! [23] |
|
166 |
|
167 |
|
168 //! [24] |
|
169 make all |
|
170 //! [24] |
|
171 |
|
172 |
|
173 //! [25] |
|
174 build_pass:CONFIG(debug, debug|release) { |
|
175 unix: TARGET = $$join(TARGET,,,_debug) |
|
176 else: TARGET = $$join(TARGET,,,d) |
|
177 } |
|
178 //! [25] |
|
179 |
|
180 |
|
181 //! [26] |
|
182 CONFIG += qt console newstuff |
|
183 ... |
|
184 newstuff { |
|
185 SOURCES += new.cpp |
|
186 HEADERS += new.h |
|
187 } |
|
188 //! [26] |
|
189 |
|
190 |
|
191 //! [27] |
|
192 DEFINES += USE_MY_STUFF QT_DLL |
|
193 //! [27] |
|
194 |
|
195 |
|
196 //! [28] |
|
197 myFiles.sources = path\*.png |
|
198 DEPLOYMENT += myFiles |
|
199 //! [28] |
|
200 |
|
201 |
|
202 //! [29] |
|
203 myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\* |
|
204 myFiles.path = \some\path\on\device |
|
205 someother.sources = C:\additional\files\* |
|
206 someother.path = \myFiles\path2 |
|
207 DEPLOYMENT += myFiles someother |
|
208 //! [29] |
|
209 |
|
210 |
|
211 //! [30] |
|
212 DESTDIR = ../../lib |
|
213 //! [30] |
|
214 |
|
215 |
|
216 //! [31] |
|
217 DISTFILES += ../program.txt |
|
218 //! [31] |
|
219 |
|
220 |
|
221 //! [32] |
|
222 FORMS = mydialog.ui \ |
|
223 mywidget.ui \ |
|
224 myconfig.ui |
|
225 //! [32] |
|
226 |
|
227 |
|
228 //! [33] |
|
229 FORMS3 = my_uic3_dialog.ui \ |
|
230 my_uic3_widget.ui \ |
|
231 my_uic3_config.ui |
|
232 //! [33] |
|
233 |
|
234 |
|
235 //! [34] |
|
236 HEADERS = myclass.h \ |
|
237 login.h \ |
|
238 mainwindow.h |
|
239 //! [34] |
|
240 |
|
241 |
|
242 //! [35] |
|
243 INCLUDEPATH = c:/msdev/include d:/stl/include |
|
244 //! [35] |
|
245 |
|
246 |
|
247 //! [36] |
|
248 target.path += $$[QT_INSTALL_PLUGINS]/imageformats |
|
249 INSTALLS += target |
|
250 //! [36] |
|
251 |
|
252 |
|
253 //! [37] |
|
254 LEXSOURCES = lexer.l |
|
255 //! [37] |
|
256 |
|
257 |
|
258 //! [38] |
|
259 unix:LIBS += -L/usr/local/lib -lmath |
|
260 win32:LIBS += c:/mylibs/math.lib |
|
261 //! [38] |
|
262 |
|
263 |
|
264 //! [39] |
|
265 CONFIG += no_lflags_merge |
|
266 //! [39] |
|
267 |
|
268 |
|
269 //! [40] |
|
270 unix:MOC_DIR = ../myproject/tmp |
|
271 win32:MOC_DIR = c:/myproject/tmp |
|
272 //! [40] |
|
273 |
|
274 |
|
275 //! [41] |
|
276 unix:OBJECTS_DIR = ../myproject/tmp |
|
277 win32:OBJECTS_DIR = c:/myproject/tmp |
|
278 //! [41] |
|
279 |
|
280 |
|
281 //! [42] |
|
282 app { |
|
283 # Conditional code for 'app' template here |
|
284 } |
|
285 //! [42] |
|
286 |
|
287 |
|
288 //! [43] |
|
289 FRAMEWORK_HEADERS.version = Versions |
|
290 FRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.h |
|
291 FRAMEWORK_HEADERS.path = Headers |
|
292 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS |
|
293 //! [43] |
|
294 |
|
295 |
|
296 //! [44] |
|
297 QMAKE_BUNDLE_EXTENSION = .myframework |
|
298 //! [44] |
|
299 |
|
300 |
|
301 //! [45] |
|
302 QMAKE_RESOURCE_FLAGS += -threshold 0 -compress 9 |
|
303 //! [45] |
|
304 |
|
305 |
|
306 //! [46] |
|
307 QMAKE_UIC = uic -L /path/to/plugin |
|
308 //! [46] |
|
309 |
|
310 |
|
311 //! [47] |
|
312 QT -= gui # Only the core module is used. |
|
313 //! [47] |
|
314 |
|
315 |
|
316 //! [48] |
|
317 unix:RCC_DIR = ../myproject/resources |
|
318 win32:RCC_DIR = c:/myproject/resources |
|
319 //! [48] |
|
320 |
|
321 |
|
322 //! [49] |
|
323 SOURCES = myclass.cpp \ |
|
324 login.cpp \ |
|
325 mainwindow.cpp |
|
326 //! [49] |
|
327 |
|
328 |
|
329 //! [50] |
|
330 SUBDIRS = kernel \ |
|
331 tools |
|
332 //! [50] |
|
333 |
|
334 |
|
335 //! [51] |
|
336 CONFIG += ordered |
|
337 //! [51] |
|
338 |
|
339 |
|
340 //! [52] |
|
341 TEMPLATE = app |
|
342 TARGET = myapp |
|
343 SOURCES = main.cpp |
|
344 //! [52] |
|
345 |
|
346 |
|
347 //! [53] |
|
348 TEMPLATE = lib |
|
349 SOURCES = main.cpp |
|
350 TARGET = mylib |
|
351 //! [53] |
|
352 |
|
353 |
|
354 //! [54] |
|
355 unix:UI_DIR = ../myproject/ui |
|
356 win32:UI_DIR = c:/myproject/ui |
|
357 //! [54] |
|
358 |
|
359 |
|
360 //! [55] |
|
361 unix:UI_HEADERS_DIR = ../myproject/ui/include |
|
362 win32:UI_HEADERS_DIR = c:/myproject/ui/include |
|
363 //! [55] |
|
364 |
|
365 |
|
366 //! [56] |
|
367 unix:UI_SOURCES_DIR = ../myproject/ui/src |
|
368 win32:UI_SOURCES_DIR = c:/myproject/ui/src |
|
369 //! [56] |
|
370 |
|
371 |
|
372 //! [57] |
|
373 VERSION = 1.2.3 |
|
374 //! [57] |
|
375 |
|
376 |
|
377 //! [58] |
|
378 YACCSOURCES = moc.y |
|
379 //! [58] |
|
380 |
|
381 |
|
382 //! [59] |
|
383 FILE = /etc/passwd |
|
384 FILENAME = $$basename(FILE) #passwd |
|
385 //! [59] |
|
386 |
|
387 |
|
388 //! [60] |
|
389 CONFIG = debug |
|
390 CONFIG += release |
|
391 CONFIG(release, debug|release):message(Release build!) #will print |
|
392 CONFIG(debug, debug|release):message(Debug build!) #no print |
|
393 //! [60] |
|
394 |
|
395 |
|
396 //! [61] |
|
397 contains( drivers, network ) { |
|
398 # drivers contains 'network' |
|
399 message( "Configuring for network build..." ) |
|
400 HEADERS += network.h |
|
401 SOURCES += network.cpp |
|
402 } |
|
403 //! [61] |
|
404 |
|
405 |
|
406 //! [62] |
|
407 error(An error has occurred in the configuration process.) |
|
408 //! [62] |
|
409 |
|
410 |
|
411 //! [63] |
|
412 exists( $(QTDIR)/lib/libqt-mt* ) { |
|
413 message( "Configuring for multi-threaded Qt..." ) |
|
414 CONFIG += thread |
|
415 } |
|
416 //! [63] |
|
417 |
|
418 |
|
419 //! [64] |
|
420 MY_VAR = one two three four |
|
421 MY_VAR2 = $$join(MY_VAR, " -L", -L) -Lfive |
|
422 MY_VAR3 = $$member(MY_VAR, 2) $$find(MY_VAR, t.*) |
|
423 //! [64] |
|
424 |
|
425 |
|
426 //! [65] |
|
427 LIST = 1 2 3 |
|
428 for(a, LIST):exists(file.$${a}):message(I see a file.$${a}!) |
|
429 //! [65] |
|
430 |
|
431 |
|
432 //! [66] |
|
433 include( shared.pri ) |
|
434 OPTIONS = standard custom |
|
435 !include( options.pri ) { |
|
436 message( "No custom build options specified" ) |
|
437 OPTIONS -= custom |
|
438 } |
|
439 //! [66] |
|
440 |
|
441 |
|
442 //! [67] |
|
443 isEmpty( CONFIG ) { |
|
444 CONFIG += qt warn_on debug |
|
445 } |
|
446 //! [67] |
|
447 |
|
448 |
|
449 //! [68] |
|
450 message( "This is a message" ) |
|
451 //! [68] |
|
452 |
|
453 |
|
454 //! [69] |
|
455 !build_pass:message( "This is a message" ) |
|
456 //! [69] |
|
457 |
|
458 |
|
459 //! [70] |
|
460 This is a test. |
|
461 //! [70] |
|
462 |
|
463 |
|
464 //! [71] |
|
465 system(ls /bin):HAS_BIN=FALSE |
|
466 //! [71] |
|
467 |
|
468 |
|
469 //! [72] |
|
470 UNAME = $$system(uname -s) |
|
471 contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me ) |
|
472 //! [72] |
|
473 |
|
474 |
|
475 //! [73] |
|
476 ARGS = 1 2 3 2 5 1 |
|
477 ARGS = $$unique(ARGS) #1 2 3 5 |
|
478 //! [73] |
|
479 |
|
480 |
|
481 //! [74] |
|
482 qmake -set VARIABLE VALUE |
|
483 //! [74] |
|
484 |
|
485 |
|
486 //! [75] |
|
487 qmake -query VARIABLE |
|
488 qmake -query #queries all current VARIABLE/VALUE pairs.. |
|
489 //! [75] |
|
490 |
|
491 |
|
492 //! [76] |
|
493 qmake -query "1.06a/VARIABLE" |
|
494 //! [76] |
|
495 |
|
496 |
|
497 //! [77] |
|
498 qmake -query "QT_INSTALL_PREFIX" |
|
499 //! [77] |
|
500 |
|
501 |
|
502 //! [78] |
|
503 QMAKE_VERS = $$[QMAKE_VERSION] |
|
504 //! [78] |
|
505 |
|
506 |
|
507 //! [79] |
|
508 documentation.path = /usr/local/program/doc |
|
509 documentation.files = docs/* |
|
510 //! [79] |
|
511 |
|
512 |
|
513 //! [80] |
|
514 INSTALLS += documentation |
|
515 //! [80] |
|
516 |
|
517 |
|
518 //! [81] |
|
519 unix:documentation.extra = create_docs; mv master.doc toc.doc |
|
520 //! [81] |
|
521 |
|
522 |
|
523 //! [82] |
|
524 target.path = /usr/local/myprogram |
|
525 INSTALLS += target |
|
526 //! [82] |
|
527 |
|
528 |
|
529 //! [83] |
|
530 CONFIG += create_prl |
|
531 //! [83] |
|
532 |
|
533 |
|
534 //! [84] |
|
535 CONFIG += link_prl |
|
536 //! [84] |
|
537 |
|
538 |
|
539 //! [85] |
|
540 QMAKE_EXT_MOC = .mymoc |
|
541 //! [85] |
|
542 |
|
543 |
|
544 //! [86] |
|
545 mytarget.target = .buildfile |
|
546 mytarget.commands = touch $$mytarget.target |
|
547 mytarget.depends = mytarget2 |
|
548 |
|
549 mytarget2.commands = @echo Building $$mytarget.target |
|
550 //! [86] |
|
551 |
|
552 |
|
553 //! [87] |
|
554 QMAKE_EXTRA_TARGETS += mytarget mytarget2 |
|
555 //! [87] |
|
556 |
|
557 |
|
558 //! [88] |
|
559 new_moc.output = moc_${QMAKE_FILE_BASE}.cpp |
|
560 new_moc.commands = moc ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT} |
|
561 new_moc.depend_command = g++ -E -M ${QMAKE_FILE_NAME} | sed "s,^.*: ,," |
|
562 new_moc.input = NEW_HEADERS |
|
563 QMAKE_EXTRA_COMPILERS += new_moc |
|
564 //! [88] |
|
565 |
|
566 |
|
567 //! [89] |
|
568 TARGET = myapp |
|
569 //! [89] |
|
570 |
|
571 |
|
572 //! [90] |
|
573 DEFINES += QT_DLL |
|
574 //! [90] |
|
575 |
|
576 |
|
577 //! [91] |
|
578 DEFINES -= QT_DLL |
|
579 //! [91] |
|
580 |
|
581 |
|
582 //! [92] |
|
583 DEFINES *= QT_DLL |
|
584 //! [92] |
|
585 |
|
586 |
|
587 //! [93] |
|
588 DEFINES ~= s/QT_[DT].+/QT |
|
589 //! [93] |
|
590 |
|
591 |
|
592 //! [94] |
|
593 EVERYTHING = $$SOURCES $$HEADERS |
|
594 message("The project contains the following files:") |
|
595 message($$EVERYTHING) |
|
596 //! [94] |
|
597 |
|
598 |
|
599 //! [95] |
|
600 win32:DEFINES += QT_DLL |
|
601 //! [95] |
|
602 |
|
603 |
|
604 //! [96] |
|
605 win32:xml { |
|
606 message(Building for Windows) |
|
607 SOURCES += xmlhandler_win.cpp |
|
608 } else:xml { |
|
609 SOURCES += xmlhandler.cpp |
|
610 } else { |
|
611 message("Unknown configuration") |
|
612 } |
|
613 //! [96] |
|
614 |
|
615 |
|
616 //! [97] |
|
617 MY_VARIABLE = value |
|
618 //! [97] |
|
619 |
|
620 |
|
621 //! [98] |
|
622 MY_DEFINES = $$DEFINES |
|
623 //! [98] |
|
624 |
|
625 |
|
626 //! [99] |
|
627 MY_DEFINES = $${DEFINES} |
|
628 //! [99] |
|
629 |
|
630 |
|
631 //! [100] |
|
632 TARGET = myproject_$${TEMPLATE} |
|
633 //! [100] |
|
634 |
|
635 |
|
636 //! [101] |
|
637 target.path = $$[QT_INSTALL_PLUGINS]/designer |
|
638 INSTALLS += target |
|
639 //! [101] |
|
640 |
|
641 |
|
642 //! [102] |
|
643 defineReplace(functionName){ |
|
644 #function code |
|
645 } |
|
646 //! [102] |
|
647 |
|
648 |
|
649 //! [103] |
|
650 CONFIG += myfeatures |
|
651 //! [103] |
|
652 |
|
653 |
|
654 //! [104] |
|
655 // Add C includes here |
|
656 |
|
657 #if defined __cplusplus |
|
658 // Add C++ includes here |
|
659 #include <stdlib> |
|
660 #include <iostream> |
|
661 #include <vector> |
|
662 #include <QApplication> // Qt includes |
|
663 #include <QPushButton> |
|
664 #include <QLabel> |
|
665 #include "thirdparty/include/libmain.h" |
|
666 #include "my_stable_class.h" |
|
667 ... |
|
668 #endif |
|
669 //! [104] |
|
670 |
|
671 |
|
672 //! [105] |
|
673 PRECOMPILED_HEADER = stable.h |
|
674 //! [105] |
|
675 |
|
676 |
|
677 //! [106] |
|
678 precompile_header:!isEmpty(PRECOMPILED_HEADER) { |
|
679 DEFINES += USING_PCH |
|
680 } |
|
681 //! [106] |
|
682 |
|
683 |
|
684 //! [107] |
|
685 PRECOMPILED_HEADER = window.h |
|
686 SOURCES = window.cpp |
|
687 //! [107] |
|
688 |
|
689 |
|
690 //! [108] |
|
691 SOURCES += hello.cpp |
|
692 //! [108] |
|
693 |
|
694 |
|
695 //! [109] |
|
696 SOURCES += hello.cpp |
|
697 SOURCES += main.cpp |
|
698 //! [109] |
|
699 |
|
700 |
|
701 //! [110] |
|
702 SOURCES = hello.cpp \ |
|
703 main.cpp |
|
704 //! [110] |
|
705 |
|
706 |
|
707 //! [111] |
|
708 HEADERS += hello.h |
|
709 SOURCES += hello.cpp |
|
710 SOURCES += main.cpp |
|
711 //! [111] |
|
712 |
|
713 |
|
714 //! [112] |
|
715 TARGET = helloworld |
|
716 //! [112] |
|
717 |
|
718 |
|
719 //! [113] |
|
720 CONFIG += qt |
|
721 HEADERS += hello.h |
|
722 SOURCES += hello.cpp |
|
723 SOURCES += main.cpp |
|
724 //! [113] |
|
725 |
|
726 |
|
727 //! [114] |
|
728 qmake -o Makefile hello.pro |
|
729 //! [114] |
|
730 |
|
731 |
|
732 //! [115] |
|
733 qmake -tp vc hello.pro |
|
734 //! [115] |
|
735 |
|
736 |
|
737 //! [116] |
|
738 CONFIG += qt debug |
|
739 HEADERS += hello.h |
|
740 SOURCES += hello.cpp |
|
741 SOURCES += main.cpp |
|
742 //! [116] |
|
743 |
|
744 |
|
745 //! [117] |
|
746 win32 { |
|
747 SOURCES += hellowin.cpp |
|
748 } |
|
749 //! [117] |
|
750 |
|
751 |
|
752 //! [118] |
|
753 CONFIG += qt debug |
|
754 HEADERS += hello.h |
|
755 SOURCES += hello.cpp |
|
756 SOURCES += main.cpp |
|
757 win32 { |
|
758 SOURCES += hellowin.cpp |
|
759 } |
|
760 unix { |
|
761 SOURCES += hellounix.cpp |
|
762 } |
|
763 //! [118] |
|
764 |
|
765 |
|
766 //! [119] |
|
767 !exists( main.cpp ) { |
|
768 error( "No main.cpp file found" ) |
|
769 } |
|
770 //! [119] |
|
771 |
|
772 |
|
773 //! [120] |
|
774 CONFIG += qt debug |
|
775 HEADERS += hello.h |
|
776 SOURCES += hello.cpp |
|
777 SOURCES += main.cpp |
|
778 win32 { |
|
779 SOURCES += hellowin.cpp |
|
780 } |
|
781 unix { |
|
782 SOURCES += hellounix.cpp |
|
783 } |
|
784 !exists( main.cpp ) { |
|
785 error( "No main.cpp file found" ) |
|
786 } |
|
787 //! [120] |
|
788 |
|
789 |
|
790 //! [121] |
|
791 win32 { |
|
792 debug { |
|
793 CONFIG += console |
|
794 } |
|
795 } |
|
796 //! [121] |
|
797 |
|
798 |
|
799 //! [122] |
|
800 CONFIG += qt debug |
|
801 HEADERS += hello.h |
|
802 SOURCES += hello.cpp |
|
803 SOURCES += main.cpp |
|
804 win32 { |
|
805 SOURCES += hellowin.cpp |
|
806 } |
|
807 unix { |
|
808 SOURCES += hellounix.cpp |
|
809 } |
|
810 !exists( main.cpp ) { |
|
811 error( "No main.cpp file found" ) |
|
812 } |
|
813 win32:debug { |
|
814 CONFIG += console |
|
815 } |
|
816 //! [122] |
|
817 |
|
818 |
|
819 //! [123] |
|
820 TEMPLATE = app |
|
821 DESTDIR = c:/helloapp |
|
822 HEADERS += hello.h |
|
823 SOURCES += hello.cpp |
|
824 SOURCES += main.cpp |
|
825 DEFINES += QT_DLL |
|
826 CONFIG += qt warn_on release |
|
827 //! [123] |
|
828 |
|
829 |
|
830 //! [124] |
|
831 make all |
|
832 //! [124] |
|
833 |
|
834 |
|
835 //! [125] |
|
836 make |
|
837 //! [125] |
|
838 |
|
839 |
|
840 //! [126] |
|
841 make install |
|
842 //! [126] |
|
843 |
|
844 |
|
845 //! [127] |
|
846 CONFIG(debug, debug|release) { |
|
847 mac: TARGET = $$join(TARGET,,,_debug) |
|
848 win32: TARGET = $$join(TARGET,,d) |
|
849 } |
|
850 //! [127] |
|
851 |
|
852 //! [128] |
|
853 customplugin.sources = customimageplugin.dll |
|
854 customplugin.sources += c:\myplugins\othercustomimageplugin.dll |
|
855 customplugin.path = imageformats |
|
856 dynamiclibrary.sources = mylib.dll helper.exe |
|
857 dynamiclibrary.path = \sys\bin |
|
858 globalplugin.sources = someglobalimageplugin.dll |
|
859 globalplugin.path = \resource\qt\plugins\imageformats |
|
860 DEPLOYMENT += customplugin dynamiclibrary globalplugin |
|
861 //! [128] |
|
862 |
|
863 //! [129] |
|
864 TARGET.EPOCALLOWDLLDATA = 1 |
|
865 //! [129] |
|
866 |
|
867 //! [130] |
|
868 TARGET.EPOCHEAPSIZE = 10000 10000000 |
|
869 TARGET.EPOCSTACKSIZE = 0x8000 |
|
870 //! [130] |
|
871 |
|
872 //! [131] |
|
873 QMAKE_CXXFLAGS.CW += -O2 |
|
874 QMAKE_CXXFLAGS.ARMCC += -O0 |
|
875 //! [131] |
|
876 |
|
877 //! [132] |
|
878 TARGET.UID2 = 0x00000001 |
|
879 TARGET.UID3 = 0x00000002 |
|
880 TARGET.SID = 0x00000003 |
|
881 TARGET.VID = 0x00000004 |
|
882 //! [132] |
|
883 |
|
884 //! [133] |
|
885 TARGET.CAPABILITY += AllFiles |
|
886 //! [133] |
|
887 |
|
888 //! [134] |
|
889 TARGET.CAPABILITY = ALL -TCB |
|
890 //! [134] |
|
891 |
|
892 //! [135] |
|
893 TARGET.EPOCHEAPSIZE = 10000 10000000 |
|
894 //! [135] |
|
895 |
|
896 //! [136] |
|
897 TARGET.EPOCSTACKSIZE = 0x8000 |
|
898 //! [136] |
|
899 |
|
900 //! [137] |
|
901 MMP_RULES += "DEFFILE hello.def" |
|
902 //! [137] |
|
903 |
|
904 //! [138] |
|
905 myBlock = \ |
|
906 "START RESOURCE foo.rss" \ |
|
907 "TARGET bar" \ |
|
908 "TARGETPATH private\10001234" \ |
|
909 "HEADER" \ |
|
910 "LANG 01" \ |
|
911 "UID 0x10002345 0x10003456" \ |
|
912 "END" |
|
913 |
|
914 MMP_RULES += myBlock |
|
915 //! [138] |
|
916 |
|
917 //! [139] |
|
918 myIfdefBlock = \ |
|
919 "$${LITERAL_HASH}ifdef WINSCW" \ |
|
920 "DEFFILE hello_winscw.def" \ |
|
921 "$${LITERAL_HASH}endif" |
|
922 |
|
923 MMP_RULES += myIfdefBlock |
|
924 //! [139] |
|
925 |
|
926 //! [140] |
|
927 somelib.sources = somelib.dll |
|
928 somelib.path = \sys\bin |
|
929 somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ |
|
930 "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" |
|
931 justdep.pkg_prerules = "(0xAAAABBBB), 0, 2, 0, {\"My Framework\"}" |
|
932 DEPLOYMENT += somelib justdep |
|
933 //! [140] |
|
934 |
|
935 //! [141] |
|
936 default_deployment.pkg_prerules -= pkg_platform_dependencies |
|
937 my_deployment.pkg_prerules = "[0x11223344],0,0,0,{\"SomeSpecificDeviceID\"}" |
|
938 DEPLOYMENT += my_deployment |
|
939 //! [141] |
|
940 |
|
941 //! [142] |
|
942 DEPLOYMENT_PLUGIN += qjpeg |
|
943 //! [142] |
|
944 |
|
945 //! [143] |
|
946 myextension = \ |
|
947 "start extension myextension" \ |
|
948 "$${LITERAL_HASH}if defined(WINSCW)" \ |
|
949 "option MYOPTION foo" \ |
|
950 "$${LITERAL_HASH}endif" \ |
|
951 "option MYOPTION bar" \ |
|
952 "end" |
|
953 BLD_INF_RULES.prj_extensions += myextension |
|
954 //! [143] |
|
955 |
|
956 //! [144] |
|
957 RSS_RULES += "hidden = KAppIsHidden;" |
|
958 //! [144] |
|
959 |
|
960 //! [145] |
|
961 myrssrules = \ |
|
962 "hidden = KAppIsHidden;" \ |
|
963 "launch = KAppLaunchInBackground;" \ |
|
964 RSS_RULES += myrssrules |
|
965 //! [145] |
|
966 |
|
967 //! [146] |
|
968 DEPLOYMENT.installer_header = 0x12345678 |
|
969 //! [146] |
|
970 |
|
971 //! [147] |
|
972 DEPLOYMENT.installer_header = "$${LITERAL_HASH}{\"My Application Installer\"},(0x12345678),1,0,0" |
|
973 //! [147] |
|
974 |
|
975 //! [148] |
|
976 # Set conditional libraries |
|
977 LIB.MARM = "LIBRARY myarm.lib" |
|
978 LIB.WINSCW = "LIBRARY mywinscw.lib" |
|
979 LIB.default = "LIBRARY mydefault.lib" |
|
980 |
|
981 # Add the conditional MMP rules |
|
982 MYCONDITIONS = MARM WINSCW |
|
983 MYVARIABLES = LIB |
|
984 |
|
985 addMMPRules(MYCONDITIONS, MYVARIABLES) |
|
986 //! [148] |
|
987 |
|
988 //! [149] |
|
989 SUBDIRS += my_executable my_library |
|
990 my_executable.subdir = app |
|
991 my_executable.depends = my_library |
|
992 my_library.subdir = lib |
|
993 //! [149] |
|
994 |
|
995 //! [150] |
|
996 symbian { |
|
997 SUBDIRS += emulator_dll |
|
998 emulator_dll.condition = WINSCW |
|
999 } |
|
1000 //! [150] |
|
1001 |
|
1002 //! [151] |
|
1003 RSS_RULES.service_list += "uid = 0x12345678; datatype_list = \{\}; opaque_data = r_my_icon;" |
|
1004 RSS_RULES.footer +="RESOURCE CAPTION_AND_ICON_INFO r_my_icon \{ icon_file =\"$$PWD/my_icon.svg\"; \}" |
|
1005 //! [151] |