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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/qmake/book/qmake-commandreference.leaf:3 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> qmake Command Reference</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><p align="right">[<a href="qmake-manual-7.html">Prev: Using Precompiled Headers</a>] [<a href="qmake-manual.html">Home</a>]</p>
<h2 align="center"> qmake Command Reference</h2>
<h3><a name="1"></a>qmake Command Reference</h3>
<ul><li><p><a href="qmake-manual-8.html#About">About This Reference</a></p>
<li><p><a href="qmake-manual-8.html#Commands">Command Line Options</a></p>
<li><p><a href="qmake-manual-8.html#SystemVariables">System Variables</a></p>
<li><p><a href="qmake-manual-8.html#Functions">Functions</a></p>
<li><p><a href="qmake-manual-8.html#Properties">Properties</a></p>
<li><p><a href="qmake-manual-8.html#Environment">Environment Variables and Configuration</a></p>
<li><p><a href="qmake-manual-8.html#Extensions">File Extensions</a></p>
<li><p><a href="qmake-manual-8.html#Customizing">Customizing Makefile Output</a></p>
</ul><a name="About"></a><h3><a name="2"></a>About This Reference</h3>
<p>This reference is a detailed index of all command line options, configurations and internal variables used by the cross-platform makefile generation utility <em>qmake</em>.</p>
<p>In addition to the variables and functions described in the following sections, <em>qmake</em> project files may also include comments. Comments begin with the '#' symbol and run to the end of the line.</p>
<a name="Commands"></a><h3><a name="3"></a>Command Line Options</h3>
<h4><a name="3-1"></a>Syntax</h4>
<pre>
qmake [options] files
</pre>
<h4><a name="3-2"></a>Options</h4>
<p>The following options can be specified on the command line to <em>qmake</em>:</p>
<ul><li><p><tt>-o</tt> file <br> <em>qmake</em> output will be directed to <em>file</em>. if this argument is not specified, then <em>qmake</em> will try to guess a suitable name. If '-' is specified, output is directed to stdout.</p>
<li><p><tt>-unix</tt> <br> <em>qmake</em> will run in unix mode. In this mode, Unix file naming and path conventions will be used, additionally testing for unix (as a scope) will succeed. This is the default mode on all Unices.</p>
<li><p><tt>-macx</tt> <br> <em>qmake</em> will run in Mac OS X mode. In this mode, Unix file naming and path conventions will be used, additionally testing for macx (as a scope) will succeed. This is the default mode on Mac OS X.</p>
<li><p><tt>-win32</tt> <br> <em>qmake</em> will run in win32 mode. In this mode, Windows file naming and path conventions will be used, additionally testing for win32 (as a scope) will succeed. This is the default mode on Windows.</p>
<li><p><tt>-d</tt> <br> <em>qmake</em> will output (hopefully) useful debugging information.</p>
<li><p><tt>-t</tt> tmpl <br> <em>qmake</em> will override any set TEMPLATE variables with tmpl, but only <em>after</em> the .pro file has been processed.</p>
<li><p><tt>-tp</tt> prefix <br> <em>qmake</em> will add the prefix to the TEMPLATE variable.</p>
<li><p><tt>-help</tt> <br> <em>qmake</em> will go over these features and give some useful help.</p>
</ul><p>There are also warning options that can help to find problems in your project file:</p>
<ul><li><p><tt>-Wall</tt> <br> With this <em>qmake</em> will turn on all known warnings.</p>
<li><p><tt>-Wnone</tt> <br> No warning information will be generated by <em>qmake</em>.</p>
<li><p><tt>-Wparser</tt> <br> <em>qmake</em> will only generate parser warnings, this will alert you to common pitfalls, and potential problems in the parsing of your .pro files.</p>
<li><p><tt>-Wlogic</tt> <br> Again <em>qmake</em> will warn of common pitfalls, and potential problems. This can include (but not limited to) checking if a file is placed into a list of files multiple times, if a file cannot be found, etc.</p>
</ul><p><em>qmake</em> supports two different modes of operation. The first mode, which is the default is makefile generation. In this mode, <em>qmake</em> will take a .pro file and turn it into a makefile. Creating makefiles is covered by this reference guide, there is another mode which generates .pro files.</p>
<p>To toggle between these modes you must specify in the first argument what mode you want to use. If no mode is specified, <em>qmake</em> will assume you want makefile mode. The available modes are:</p>
<ul><li><p><tt>-makefile</tt> <br> <em>qmake</em> output will be a makefile (<a href="qmake-manual-8.html#MakefileMode">Makefile mode</a>).</p>
<li><p><tt>-project</tt> <br> <em>qmake</em> output will be a project file (<a href="qmake-manual-8.html#ProjectfileMode">Project file mode</a>).</p>
</ul><a name="MakefileMode"></a><h5><a name="3-2-1"></a>Makefile Mode</h5>
<p>In Makefile mode <em>qmake</em> will generate a makefile. Additionally you may supply the following arguments in this mode:</p>
<ul><li><p><tt>-after</tt> <br> <em>qmake</em> will process assignments given on the commandline after the specified files.</p>
<li><p><tt>-nocache</tt> <br> <em>qmake</em> will ignore the .qmake.cache file.</p>
<li><p><tt>-nodepend</tt> <br> <em>qmake</em> will not generate any dependency information.</p>
<li><p><tt>-cache</tt> file <br> <em>qmake</em> will use <em>file</em> as the cache file, ignoring any other .qmake.cache file found</p>
<li><p><tt>-spec</tt> spec <br> <em>qmake</em> will use <em>spec</em> as a path to platform-compiler information and QMAKESPEC will be ignored.</p>
</ul><p>The <tt>files</tt> argument can be a list of one or more project files, separated by spaces. You may also pass qmake assignments on the command line here and they will be processed before all files specified, for example:</p>
<p>qmake -makefile -unix -o Makefile "CONFIG+=test" test.pro</p>
<p>If however you are certain you want your variables processed after the the files specified, then you may pass the -after argument. When this is specified all assignments on the commandline after the -after option will be postponed until after the specified files are parsed.</p>
<p>This will generate a Makefile, from test.pro with Unix pathnames. However many of these arguments aren't necessary as they are the default. Therefore the line can be simplified on Unix to:</p>
<p>qmake "CONFIG+=test" test.pro</p>
<a name="ProjectfileMode"></a><h5><a name="3-2-2"></a>Projectfile Mode</h5>
<p>In Projectfile mode <em>qmake</em> will generate a project file. Additionally, you may supply the following arguments in this mode:</p>
<ul><li><p><tt>-r</tt> <br> <em>qmake</em> will look through supplied directories recursively</p>
<li><p><tt>-nopwd</tt> <br> <em>qmake</em> will not look in your current working directory for source code and only use the specified <tt>files</tt></p>
</ul><p>The <tt>files</tt> argument can be a list of files or directories. If a directory is specified, then it will be included in the <a href="qmake-manual-8.html#DEPENDPATH">DEPENDPATH</a> variable and relevant code from there will be included in the generated project file, if a file is given it will go into the correct variable depending on extension (i.e. .ui files go into FORMS, .cpp files go into SOURCES, etc). Here too you may pass assignments on the commandline, when doing so these assignments will be placed last in the generated .pro file.</p>
<a name="SystemVariables"></a><h3><a name="4"></a>System Variables</h3>
<ul><li><p><a href="qmake-manual-8.html#FrequentlyUsedSystemVariables">Frequently Used System Variables</a></p>
<li><p><a href="qmake-manual-8.html#RarelyUsedSystemVariables">Rarely Used System Variables</a></p>
</ul><a name="FrequentlyUsedSystemVariables"></a><h4><a name="4-1"></a>Frequently Used System Variables</h4>
<p>The following variables are recognized by <em>qmake</em> and are used most frequently when creating project files.</p>
<a name="CONFIG"></a><h5><a name="4-1-1"></a>CONFIG</h5>
<p>The <tt>CONFIG</tt> variable specifies project configuration and compiler options. The values will be recognized internally by <em>qmake</em> and have special meaning. They are as follows.</p>
<p>These <tt>CONFIG</tt> values control compilation flags:</p>
<ul><li><p>release - Compile with optimization enabled, ignored if "debug" is specified</p>
<li><p>debug - Compile with debug options enabled</p>
<li><p>warn_on - The compiler should emit more warnings than normally, ignored if "warn_off" is specified</p>
<li><p>warn_off - The compiler should only emit severe warnings.</p>
</ul><p>These options define the application/library type:</p>
<ul><li><p>qt - The target is a TQt application/library and retquires the TQt header files/library. The proper include and library paths for the TQt library will automatically be added to the project.</p>
<li><p>opengl - The target retquires the OpenGL (or Mesa) headers/libraries. The proper include and library paths for these libraries will automatically be added to the project.</p>
<li><p>thread - The target is a multi-threaded application or library. The proper defines and compiler flags will automatically be added to the project.</p>
<li><p>x11 - The target is a X11 application or library. The proper include paths and libraries will automatically be added to the project.</p>
<li><p>windows - The target is a Win32 window application (app only). The proper include paths,compiler flags and libraries will automatically be added to the project.</p>
<li><p>console - The target is a Win32 console application (app only). The proper include paths, compiler flags and libraries will automatically be added to the project.</p>
<li><p>dll - The target is a shared object/DLL.The proper include paths, compiler flags and libraries will automatically be added to the project.</p>
<li><p>staticlib - The target is a static library (lib only). The proper compiler flags will automatically be added to the project.</p>
<li><p>plugin - The target is a plugin (lib only). This enables dll as well.</p>
</ul><p>These options are used to set the compiler flags:</p>
<ul><li><p>exceptions - Exception support is enabled</p>
<li><p>rtti - RTTI support is enabled</p>
<li><p>stl - STL support is enabled</p>
</ul><p>These options define specific things depending on the platform and/or template:</p>
<ul><li><p>flat - When using the vcapp template this will put all the source files into the source group and the header files into the header group regardless of what directory they reside in. Turning this option off will group the files within the source/header group depending on the directory they reside. This is turned on by default.</p>
</ul><p>The <tt>CONFIG</tt> variable will also be checked when resolving scopes. You may assign anything to this variable.</p>
<p>For example:</p>
<pre>
CONFIG += qt console newstuff
...
newstuff {
SOURCES += new.cpp
HEADERS += new.h
}
</pre>
<a name="DEFINES"></a><h5><a name="4-1-2"></a>DEFINES</h5>
<p><em>qmake</em> adds the values of this variable as compiler C preprocessor macros (-D option).</p>
<p>For example:</p>
<pre>
DEFINES += USE_MY_STUFF QT_DLL
</pre>
<a name="DEF_FILE"></a><h5><a name="4-1-3"></a>DEF_FILE</h5>
<p><em>This is only used on Windows when using the 'app' template</em>.</p>
<p>Specifies a .def file to be included in the project.</p>
<a name="DESTDIR"></a><h5><a name="4-1-4"></a>DESTDIR</h5>
<p>Specifies where to put the <a href="qmake-manual-8.html#TARGET">target</a> file.</p>
<p>For example:</p>
<pre>
DESTDIR = ../../lib
</pre>
<a name="DLLDESTDIR"></a><h5><a name="4-1-5"></a>DLLDESTDIR</h5>
<p>Specifies where to copy the <a href="qmake-manual-8.html#TARGET">target</a> dll.</p>
<a name="HEADERS"></a><h5><a name="4-1-6"></a>HEADERS</h5>
<p>Defines the header files for the project.</p>
<p><em>qmake</em> will generate dependency information (unless -nodepend is specified on the <a href="qmake-manual-8.html#Commands">command line</a>) for the specified headers. <em>qmake</em> will also automatically detect if <em>moc</em> is retquired by the classes in these headers, and add the appropriate dependencies and files to the project for generating and linking the moc files.</p>
<p>For example:</p>
<pre>
HEADERS = myclass.h \
login.h \
mainwindow.h
</pre>
<p>See also <a href="qmake-manual-8.html#SOURCES">SOURCES</a>.</p>
<a name="INCLUDEPATH"></a><h5><a name="4-1-7"></a>INCLUDEPATH</h5>
<p>This variable specifies the #include directories which should be searched when compiling the project. Use ';' or a space as the directory separator.</p>
<p>For example:</p>
<pre>
INCLUDEPATH = c:\msdev\include d:\stl\include
</pre>
<a name="FORMS"></a><h5><a name="4-1-8"></a>FORMS</h5>
<p>This variable specifies the .ui files (see <a href="designer-manual.html">TQt Designer</a>) to be processed through <em>uic</em> before compiling. All dependencies, headers and source files retquired to build these .ui files will automatically be added to the project.</p>
<p>For example:</p>
<pre>
FORMS = mydialog.ui \
mywidget.ui \
myconfig.ui
</pre>
<p>Note that forms should not be specified using the <tt>+=</tt> operator because this syntax is not fully supported by <em>TQt Designer</em>.</p>
<a name="LEXSOURCES"></a><h5><a name="4-1-9"></a>LEXSOURCES</h5>
<p>This variable contains a list of lex source files. All dependencies, headers and source files will automatically be added to the project for building these lex files.</p>
<p>For example:</p>
<pre>
LEXSOURCES = lexer.l
</pre>
<a name="LIBS"></a><h5><a name="4-1-10"></a>LIBS</h5>
<p>This variable contains a list of libraries to be linked into the project. If you are more comfortable with the Unix convension of -L/-l flags you are free to use them in a cross-platform manner and qmake will do the correct thing with these libraries on Windows (namely this means passing the full path of the library to the linker). The only limitation to this is the library must exist, for qmake to find which directory a -l lib lives in.</p>
<p>For example:</p>
<pre>
unix:LIBS += -lmath -L/usr/local/lib
win32:LIBS += c:\mylibs\math.lib
</pre>
<a name="MOC_DIR"></a><h5><a name="4-1-11"></a>MOC_DIR</h5>
<p>This variable specifies the directory where all intermediate moc files should be placed.</p>
<p>For example:</p>
<pre>
unix:MOC_DIR = ../myproject/tmp
win32:MOC_DIR = c:\myproject\tmp
</pre>
<a name="OBJECTS_DIR"></a><h5><a name="4-1-12"></a>OBJECTS_DIR</h5>
<p>This variable specifies the directory where all intermediate objects should be placed.</p>
<p>For example:</p>
<pre>
unix:OBJECTS_DIR = ../myproject/tmp
win32:OBJECTS__DIR = c:\myproject\tmp
</pre>
<a name="UI_DIR"></a><h5><a name="4-1-13"></a>UI_DIR</h5>
<p>This variable specifies the directory where all intermediate files from uic should be placed. This variable overrides both UI_SOURCES_DIR and UI_HEADERS_DIR.</p>
<p>For example:</p>
<pre>
unix:UI_DIR = ../myproject/ui
win32:UI_DIR = c:\myproject\ui
</pre>
<a name="UI_HEADERS_DIR"></a><h5><a name="4-1-14"></a>UI_HEADERS_DIR</h5>
<p>This variable specifies the directory where all declaration files (as generated by uic) should be placed.</p>
<p>For example:</p>
<pre>
unix:UI_HEADERS_DIR = ../myproject/ui/include
win32:UI_HEADERS_DIR = c:\myproject\ui\include
</pre>
<a name="UI_SOURCES_DIR"></a><h5><a name="4-1-15"></a>UI_SOURCES_DIR</h5>
<p>This variable specifies the directory where all implementation files (as generated by uic) should be placed.</p>
<p>For example:</p>
<pre>
unix:UI_SOURCES_DIR = ../myproject/ui/src
win32:UI_SOURCES_DIR = c:\myproject\ui\src
</pre>
<a name="RETQUIRES"></a><h5><a name="4-1-16"></a>RETQUIRES</h5>
<p>This is a special variable processed by <em>qmake</em>. If the contents of this variable do not appear in CONFIG by the time this variable is assigned, then a minimal makefile will be generated that states what dependencies (the values assigned to RETQUIRES) are missing.</p>
<p>This is mainly used in TQt's build system for building the examples.</p>
<a name="SOURCES"></a><h5><a name="4-1-17"></a>SOURCES</h5>
<p>This variable contains the name of all source files in the project.</p>
<p>For example:</p>
<pre>
SOURCES = myclass.cpp \
login.cpp \
mainwindow.cpp
</pre>
<p>See also <a href="qmake-manual-8.html#HEADERS">HEADERS</a></p>
<h5><a name="4-1-18"></a>SUBDIRS</h5>
<p>This variable, when used with the 'subdirs' <a href="qmake-manual-8.html#TEMPLATE">TEMPLATE</a> contains the names of all subdirectories to look for a project file.</p>
<p>For example:</p>
<pre>
SUBDIRS = kernel \
tools
</pre>
<a name="TARGET"></a><h5><a name="4-1-19"></a>TARGET</h5>
<p>This specifies the name of the target file.</p>
<p>For example:</p>
<pre>
TEMPLATE = app
TARGET = myapp
SOURCES = main.cpp
</pre>
<p>The project file above would produce an executable named 'myapp' on unix and 'myapp.exe' on windows.</p>
<a name="TEMPLATE"></a><h5><a name="4-1-20"></a>TEMPLATE</h5>
<p>This variable contains the name of the template to use when generating the project. The allowed values are:</p>
<ul><li><p>app - Creates a makefile for building applications (the default)</p>
<li><p>lib - Creates a makefile for building libraries</p>
<li><p>subdirs - Creates a makefile for building targets in subdirectories</p>
<li><p>vcapp - <em>win32 only</em> Creates an application project file for Visual Studio</p>
<li><p>vclib - <em>win32 only</em> Creates a library project file for Visual Studio</p>
</ul><p>For example:</p>
<pre>
TEMPLATE = lib
SOURCES = main.cpp
TARGET = mylib
</pre>
<p>The template can be overridden by specifying a new template type with the <tt>-t</tt> command line option. This overrides the template type <em>after</em> the .pro file has been processed. With .pro files that use the template type to determine how the project is built, it is necessary to declare TEMPLATE on the command line rather than use the <tt>-t</tt> option.</p>
<h5><a name="4-1-21"></a>VERSION</h5>
<p>This variable contains the version number of the library if the 'lib' <a href="qmake-manual-8.html#TEMPLATE">TEMPLATE</a> is specified.</p>
<p>For example:</p>
<pre>
VERSION = 1.2.3
</pre>
<h5><a name="4-1-22"></a>DISTFILES</h5>
<p>This variable contains a list of files to be included in the dist target. This feature is supported by UnixMake specs only.</p>
<p>For example:</p>
<pre>
DISTFILES += ../program.txt
</pre>
<a name="YACCSOURCES"></a><h5><a name="4-1-23"></a>YACCSOURCES</h5>
<p>This variable contains a list of yacc source files to be included in the project. All dependencies, headers and source files will automatically be included in the project.</p>
<p>For example:</p>
<pre>
YACCSOURCES = moc.y
</pre>
<a name="RarelyUsedSystemVariables"></a><h4><a name="4-2"></a>Rarely Used System Variables</h4>
<p>The following variables are also recognized by <em>qmake</em> but are either internal or very rarely used.</p>
<a name="DESTDIR_TARGET"></a><h5><a name="4-2-1"></a>DESTDIR_TARGET</h5>
<p>This variable is set internally by <em>qmake</em>, which is basically the DESTDIR variable with the TARGET variable appened at the end. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="DSP_TEMPLATE"></a><h5><a name="4-2-2"></a>DSP_TEMPLATE</h5>
<p>This variable is set internally by <em>qmake</em>, which specifies where the dsp template file for basing generated dsp files is stored. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="LEXIMPLS"></a><h5><a name="4-2-3"></a>LEXIMPLS</h5>
<p>This variable contains a list of lex implementation files. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="LEXOBJECTS"></a><h5><a name="4-2-4"></a>LEXOBJECTS</h5>
<p>This variable contains the names of intermediate lex object files.The value of this variable is typically handled by <em>qmake</em> and rarely needs to be modified.</p>
<a name="LITERAL_HASH"></a><h5><a name="4-2-5"></a>LITERAL_HASH</h5>
<p>This variable is used whenever a literal hash character (<tt>#</tt>) is needed in a variable declaration, perhaps as part of a file name or in a string passed to some external application.</p>
<p>For example:</p>
<pre>
# To include a literal hash character, use the $$LITERAL_HASH variable:
urlPieces = http://doc.trolltech.com/3.3/qmake-manual-8.html LITERAL_HASH
message($$join(urlPieces, $$LITERAL_HASH))
</pre>
<p>By using <tt>LITERAL_HASH</tt> in this way, the <tt>#</tt> character can be used to construct a URL for the <tt>message()</tt> function to print to the console.</p>
<a name="MAKEFILE"></a><h5><a name="4-2-6"></a>MAKEFILE</h5>
<p>This variable specifies the name of the makefile which <em>qmake</em> should use when outputting the dependency information for building a project. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="MAKEFILE_GENERATOR"></a><h5><a name="4-2-7"></a>MAKEFILE_GENERATOR</h5>
<p>This variable contains the name of the makefile generator to use when generating a makefile. The value of this variable is typically handled internally by <em>qmake</em> and rarely needs to be modified.</p>
<a name="OBJECTS"></a><h5><a name="4-2-8"></a>OBJECTS</h5>
<p>This variable is generated from the <a href="qmake-manual-8.html#SOURCES">SOURCES</a> variable. The extension of each source file will have been replaced by .o (Unix) or .obj (Win32). The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="OBJMOC"></a><h5><a name="4-2-9"></a>OBJMOC</h5>
<p>This variable is set by <em>qmake</em> if files can be found that contain the Q_OBJECT macro. <tt>OBJMOC</tt> contains the name of all intermediate moc object files. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="PRECOMPILED_HEADER"></a><h5><a name="4-2-10"></a>PRECOMPILED_HEADER</h5>
<p>This variable indicates the header file for creating a precompiled header file, to increase the compilation speed of a project. Precompiled headers are currently only supported on some platforms (Windows - all MSVC project types, Mac OS X - Xcode, Makefile, UNIX - gcc 3.3 and up).</p>
<p>On other platforms, this variable has different meaning, as noted below.</p>
<p>This variable contains a list of header files that retquire some sort of pre-compilation step (such as with moc). The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE"></a><h5><a name="4-2-11"></a>QMAKE</h5>
<p>This variable contains the name of the <em>qmake</em> program itself and is placed in generated makefiles. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKESPEC_systemvariable"></a><h5><a name="4-2-12"></a>QMAKESPEC</h5>
<p>This variable contains the name of the <em>qmake</em> configuration to use when generating makefiles. The value of this variable is typically handled by <em>qmake</em> and rarely needs to be modified. Use the <a href="qmake-manual-8.html#QMAKESPEC">QMAKESPEC</a> environment variable instead.</p>
<a name="QMAKE_APP_FLAG"></a><h5><a name="4-2-13"></a>QMAKE_APP_FLAG</h5>
<p>This variable is empty unless the 'app' <a href="qmake-manual-8.html#TEMPLATE">TEMPLATE</a> is specified. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified. Use the following instead:</p>
<pre>
app {
#conditional code for 'app' template here
}
</pre>
<a name="QMAKE_APP_OR_DLL"></a><h5><a name="4-2-14"></a>QMAKE_APP_OR_DLL</h5>
<p>This variable is empty unless the 'app' or 'dll' <a href="qmake-manual-8.html#TEMPLATE">TEMPLATE</a> is specified. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_AR_CMD"></a><h5><a name="4-2-15"></a>QMAKE_AR_CMD</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains the command for invoking the program which creates, modifies and extracts archives. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_DEBUG"></a><h5><a name="4-2-16"></a>QMAKE_CFLAGS_DEBUG</h5>
<p>This variable contains the flags for the C compiler in debug mode.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_MT"></a><h5><a name="4-2-17"></a>QMAKE_CFLAGS_MT</h5>
<p>This variable contains the compiler flags for creating a multi-threaded application or when the version of TQt that you link against is a multi-threaded statically linked library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_MT_DBG"></a><h5><a name="4-2-18"></a>QMAKE_CFLAGS_MT_DBG</h5>
<p>This variable contains the compiler flags for creating a debuggable multi-threaded application or when the version of TQt that you link against is a debuggable multi-threaded statically linked library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_MT_DLL"></a><h5><a name="4-2-19"></a>QMAKE_CFLAGS_MT_DLL</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains the compiler flags for creating a multi-threaded dll or when the version of TQt that you link against is a multi-threaded dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_MT_DLLDBG"></a><h5><a name="4-2-20"></a>QMAKE_CFLAGS_MT_DLLDBG</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains the compiler flags for creating a debuggable multi-threaded dll or when the version of TQt that you link against is a debuggable multi-threaded statically linked library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_RELEASE"></a><h5><a name="4-2-21"></a>QMAKE_CFLAGS_RELEASE</h5>
<p>This variable contains the compiler flags for creating a non-debuggable application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_SHLIB"></a><h5><a name="4-2-22"></a>QMAKE_CFLAGS_SHLIB</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains the compiler flags for creating a shared library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_THREAD"></a><h5><a name="4-2-23"></a>QMAKE_CFLAGS_THREAD</h5>
<p>This variable contains the compiler flags for creating a multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_WARN_OFF"></a><h5><a name="4-2-24"></a>QMAKE_CFLAGS_WARN_OFF</h5>
<p>This variable is not empty if the warn_off <a href="qmake-manual-8.html#TEMPLATE">TEMPLATE</a> option is specified. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CFLAGS_WARN_ON"></a><h5><a name="4-2-25"></a>QMAKE_CFLAGS_WARN_ON</h5>
<p>This variable is not empty if the warn_on <a href="qmake-manual-8.html#TEMPLATE">TEMPLATE</a> option is specified. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CLEAN"></a><h5><a name="4-2-26"></a>QMAKE_CLEAN</h5>
<p>This variable contains any files which are not generated files (such as moc and uic generated files) and object files that should be removed when using "make clean".</p>
<a name="QMAKE_CXXFLAGS_DEBUG"></a><h5><a name="4-2-27"></a>QMAKE_CXXFLAGS_DEBUG</h5>
<p>This variable contains the C++ compiler flags for creating a debuggable application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_MT"></a><h5><a name="4-2-28"></a>QMAKE_CXXFLAGS_MT</h5>
<p>This variable contains the C++ compiler flags for creating a multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_MT_DBG"></a><h5><a name="4-2-29"></a>QMAKE_CXXFLAGS_MT_DBG</h5>
<p>This variable contains the C++ compiler flags for creating a debuggable multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_MT_DLL"></a><h5><a name="4-2-30"></a>QMAKE_CXXFLAGS_MT_DLL</h5>
<p><tt>This is used on Windows only</tt></p>
<p>This variable contains the C++ compiler flags for creating a multi-threaded dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_MT_DLLDBG"></a><h5><a name="4-2-31"></a>QMAKE_CXXFLAGS_MT_DLLDBG</h5>
<p><tt>This is used on Windows only</tt></p>
<p>This variable contains the C++ compiler flags for creating a multi-threaded debuggable dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_RELEASE"></a><h5><a name="4-2-32"></a>QMAKE_CXXFLAGS_RELEASE</h5>
<p>This variable contains the C++ compiler flags for creating an application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_SHLIB"></a><h5><a name="4-2-33"></a>QMAKE_CXXFLAGS_SHLIB</h5>
<p>This variable contains the C++ compiler flags for creating a shared library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_THREAD"></a><h5><a name="4-2-34"></a>QMAKE_CXXFLAGS_THREAD</h5>
<p>This variable contains the C++ compiler flags for creating a multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_WARN_OFF"></a><h5><a name="4-2-35"></a>QMAKE_CXXFLAGS_WARN_OFF</h5>
<p>This variable contains the C++ compiler flags for suppressing compiler warnings. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_CXXFLAGS_WARN_ON"></a><h5><a name="4-2-36"></a>QMAKE_CXXFLAGS_WARN_ON</h5>
<p>This variable contains C++ compiler flags for generating compiler warnings. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_EXTENSION_SHLIB"></a><h5><a name="4-2-37"></a>QMAKE_EXTENSION_SHLIB</h5>
<p>This variable contains the extention for shared libraries. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_FAILED_RETQUIREMENTS"></a><h5><a name="4-2-38"></a>QMAKE_FAILED_RETQUIREMENTS</h5>
<p>This variable contains the list of retquirements that were failed to be met when <em>qmake</em> was used. For example, the sql module is needed and wasn't compiled into TQt. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_FILETAGS"></a><h5><a name="4-2-39"></a>QMAKE_FILETAGS</h5>
<p>This variable contains the file tags needed to be entered into the makefile, such as SOURCES and HEADERS. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_INCDIR"></a><h5><a name="4-2-40"></a>QMAKE_INCDIR</h5>
<p>This variable contains the location of all known header files to be added to INCLUDEPATH when building an application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="POST_TARGETDEPS"></a><h5><a name="4-2-41"></a>POST_TARGETDEPS</h5>
<p>All libraries that the <a href="qmake-manual-8.html#TARGET">target</a> depends on can be listed in this variable. Some backends do not support this, these include MSVC Dsp, and ProjectBuilder .pbproj files. Generally this is support internally by these build tools, this is usefull for explicitly listing dependant static libraries.</p>
<p>This list will go after all builtin (and <a href="qmake-manual-8.html#PRE_TARGETDEPS">$$PRE_TARGETDEPS</a>) dependencies.</p>
<a name="PRE_TARGETDEPS"></a><h5><a name="4-2-42"></a>PRE_TARGETDEPS</h5>
<p>All libraries that the <a href="qmake-manual-8.html#TARGET">target</a> depends on can be listed in this variable. Some backends do not support this, these include MSVC Dsp, and ProjectBuilder .pbproj files. Generally this is support internally by these build tools, this is usefull for explicitly listing dependant static libraries.</p>
<p>This list will go before all builtin dependencies.</p>
<a name="QMAKE_INCDIR_OPENGL"></a><h5><a name="4-2-43"></a>QMAKE_INCDIR_OPENGL</h5>
<p>This variable contains the location of OpenGL header files to be added to INCLUDEPATH when building an application with OpenGL support. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_INCDIR_QT"></a><h5><a name="4-2-44"></a>QMAKE_INCDIR_QT</h5>
<p>This variable contains the location of all known header file paths to be added to INCLUDEPATH when building a TQt application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_INCDIR_THREAD"></a><h5><a name="4-2-45"></a>QMAKE_INCDIR_THREAD</h5>
<p>This variable contains the location of all known header file paths to be added to INCLUDEPATH when building a multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_INCDIR_X11"></a><h5><a name="4-2-46"></a>QMAKE_INCDIR_X11</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains the location of X11 header file paths to be added to INCLUDEPATH when building a X11 application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="QMAKE_LFLAGS_CONSOLE"></a><h5><a name="4-2-47"></a>QMAKE_LFLAGS_CONSOLE</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains link flags when building console programs. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-48"></a>QMAKE_LFLAGS_CONSOLE_DLL</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains link flags when building console dlls. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-49"></a>QMAKE_LFLAGS_DEBUG</h5>
<p>This variable contains link flags when building debuggable applications. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-50"></a>QMAKE_LFLAGS_PLUGIN</h5>
<p>This variable contains link flags when building plugins. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-51"></a>QMAKE_LFLAGS_QT_DLL</h5>
<p>This variable contains link flags when building programs that use the TQt library built as a dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-52"></a>QMAKE_LFLAGS_RELEASE</h5>
<p>This variable contains link flags when building applications for release. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-53"></a>QMAKE_LFLAGS_SHAPP</h5>
<p>This variable contains link flags when building applications which are using the 'app' template. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-54"></a>QMAKE_LFLAGS_SHLIB</h5>
<p>This variable contains link flags when building shared libraries The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-55"></a>QMAKE_LFLAGS_SONAME</h5>
<p>This variable specifies the link flags to set the name of shared objects, such as .so or .dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-56"></a>QMAKE_LFLAGS_THREAD</h5>
<p>This variable contains link flags when building multi-threaded projects. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-57"></a>QMAKE_LFLAGS_WINDOWS</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains link flags when building windows projects. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-58"></a>QMAKE_LFLAGS_WINDOWS_DLL</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains link flags when building windows dll projects. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-59"></a>QMAKE_LIBDIR</h5>
<p>This variable contains the location of all known library directories.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-60"></a>QMAKE_LIBDIR_FLAGS</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains the location of all library directory with -L prefixed. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-61"></a>VPATH</h5>
<p>This variable tells <em>qmake</em> where to search for files it cannot open. With this you may tell <em>qmake</em> where it may look for things like SOURCES, and if it finds an entry in SOURCES that cannot be opened it will look through the entire VPATH list to see if it can find the file on its own.</p>
<p>See also <a href="qmake-manual-8.html#DEPENDPATH">DEPENDPATH</a>.</p>
<a name="DEPENDPATH"></a><h5><a name="4-2-62"></a>DEPENDPATH</h5>
<p>This variable contains the list of all directories to look in to resolve dependencies. This will be used when crawling through 'included' files.</p>
<h5><a name="4-2-63"></a>QMAKE_LIBDIR_OPENGL</h5>
<p>This variable contains the location of the OpenGL library directory.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-64"></a>QMAKE_LIBDIR_QT</h5>
<p>This variable contains the location of the TQt library directory.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-65"></a>QMAKE_LIBDIR_X11</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains the location of the X11 library directory.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-66"></a>QMAKE_LIBS</h5>
<p>This variable contains all project libraries. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-67"></a>QMAKE_LIBS_CONSOLE</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains all project libraries that should be linked against when building a console application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-68"></a>QMAKE_LIBS_OPENGL</h5>
<p>This variable contains all OpenGL libraries. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-69"></a>QMAKE_LIBS_OPENGL_QT</h5>
<p>This variable contains all OpenGL TQt libraries.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-70"></a>QMAKE_LIBS_QT</h5>
<p>This variable contains all TQt libraries.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-71"></a>QMAKE_LIBS_QT_DLL</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains all TQt libraries when TQt is built as a dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-72"></a>QMAKE_LIBS_QT_OPENGL</h5>
<p>This variable contains all the libraries needed to link against if OpenGL support is turned on. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-73"></a>QMAKE_LIBS_QT_THREAD</h5>
<p>This variable contains all the libraries needed to link against if thread support is turned on. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-74"></a>QMAKE_LIBS_RT</h5>
<p><em>This is used with Borland compilers only</em></p>
<p>This variable contains the runtime library needed to link against when building an application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-75"></a>QMAKE_LIBS_RTMT</h5>
<p><em>This is used with Borland compilers only</em></p>
<p>This variable contains the runtime library needed to link against when building a multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-76"></a>QMAKE_LIBS_THREAD</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains all libraries that need to be linked against when building a multi-threaded application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-77"></a>QMAKE_LIBS_WINDOWS</h5>
<p><em>This is used on Windows only</em></p>
<p>This variable contains all windows libraries.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-78"></a>QMAKE_LIBS_X11</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains all X11 libraries.The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-79"></a>QMAKE_LIBS_X11SM</h5>
<p><em>This is used on Unix platforms only</em></p>
<p>This variable contains all X11 session management libraries. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-80"></a>QMAKE_LIB_FLAG</h5>
<p>This variable is not empty if the 'lib' template is specified. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-81"></a>QMAKE_LINK_SHLIB_CMD</h5>
<p>This variable contains the command to execute when creating a shared library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-82"></a>QMAKE_POST_LINK</h5>
<p>This variable contains the command to execute after linking the TARGET together. This variable is normally empty and therefore nothing is executed, additionally some backends will not support this - mostly only Makefile backends.</p>
<h5><a name="4-2-83"></a>QMAKE_PRE_LINK</h5>
<p>This variable contains the command to execute before linking the TARGET together. This variable is normally empty and therefore nothing is executed, additionally some backends will not support this - mostly only Makefile backends.</p>
<h5><a name="4-2-84"></a>QMAKE_LN_SHLIB</h5>
<p>This variable contains the command to execute when creating a link to a shared library. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-85"></a>QMAKE_MAKEFILE</h5>
<p>This variable contains the name of the makefile to create. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-86"></a>QMAKE_MOC_SRC</h5>
<p>This variable contains the names of all moc source files to generate and include in the project. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-87"></a>QMAKE_QMAKE</h5>
<p>This variable contains the location of qmake if it is not in the path. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-88"></a>QMAKE_QT_DLL</h5>
<p>This variable is not empty if TQt was built as a dll. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-89"></a>QMAKE_RUN_CC</h5>
<p>This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-90"></a>QMAKE_RUN_CC_IMP</h5>
<p>This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-91"></a>QMAKE_RUN_CXX</h5>
<p>This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-92"></a>QMAKE_RUN_CXX_IMP</h5>
<p>This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-93"></a>QMAKE_TARGET</h5>
<p>This variable contains the name of the project target. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-94"></a>QMAKE_UIC</h5>
<p>This variable contains the location of uic if it is not in the path. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<p>It can be used to specify arguments to uic as well, such as additional plugin paths. For example:</p>
<pre>
QMAKE_UIC = uic -L /path/to/plugin
</pre>
<h5><a name="4-2-95"></a>RC_FILE</h5>
<p>This variable contains the name of the resource file for the application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-96"></a>RES_FILE</h5>
<p>This variable contains the name of the resource file for the application. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-97"></a>SRCMOC</h5>
<p>This variable is set by <em>qmake</em> if files can be found that contain the Q_OBJECT macro. <tt>SRCMOC</tt> contains the name of all the generated moc files. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-98"></a>TARGET_EXT</h5>
<p>This variable specifies the target's extension. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-99"></a>TARGET_x</h5>
<p>This variable specifies the target's extension with a major version number. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-100"></a>TARGET_x.y.z</h5>
<p>This variable specifies the target's extension with version number. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-101"></a>UICIMPLS</h5>
<p>This variable contains a list of the generated implementation files by UIC. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-102"></a>UICOBJECTS</h5>
<p>This variable is generated from the UICIMPLS variable. The extension of each file will have been replaced by .o (Unix) or .obj (Win32). The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-103"></a>VER_MAJ</h5>
<p>This variable contains the major version number of the library, if the 'lib' <a href="qmake-manual-8.html#TEMPLATE">template</a> is specified.</p>
<h5><a name="4-2-104"></a>VER_MIN</h5>
<p>This variable contains the minor version number of the library, if the 'lib' <a href="qmake-manual-8.html#TEMPLATE">template</a> is specified.</p>
<h5><a name="4-2-105"></a>VER_PAT</h5>
<p>This variable contains the patch version number of the library, if the 'lib' <a href="qmake-manual-8.html#TEMPLATE">template</a> is specified.</p>
<h5><a name="4-2-106"></a>QMAKE_EXT_MOC</h5>
<p>This variable changes the extention used on included moc files.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>.</p>
<h5><a name="4-2-107"></a>QMAKE_EXT_UI</h5>
<p>This variable changes the extention used on /e Designer UI files.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>.</p>
<h5><a name="4-2-108"></a>QMAKE_EXT_PRL</h5>
<p>This variable changes the extention used on created PRL files.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>, <a href="qmake-manual-8.html#LibDepend">Library Dependencies</a>.</p>
<h5><a name="4-2-109"></a>QMAKE_EXT_LEX</h5>
<p>This variable changes the extention used on files given to lex.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>, <a href="qmake-manual-8.html#LEXSOURCES">LEXSOURCES</a>.</p>
<h5><a name="4-2-110"></a>QMAKE_EXT_YACC This variable changes the extention used on files given to yacc.</h5>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>, <a href="qmake-manual-8.html#LEXSOURCES">YACCSOURCES</a>.</p>
<h5><a name="4-2-111"></a>QMAKE_EXT_OBJ</h5>
<p>This variable changes the extention used on generated object files.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>.</p>
<h5><a name="4-2-112"></a>QMAKE_EXT_CPP</h5>
<p>This variable changes the interpretation of all suffixes in this list of values as files of type C++ source code.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>.</p>
<h5><a name="4-2-113"></a>QMAKE_EXT_H</h5>
<p>This variable changes the interpretation of all suffixes in this list of values as files of type C header files.</p>
<p>See also <a href="qmake-manual-8.html#Extensions">File Extensions</a>.</p>
<h5><a name="4-2-114"></a>YACCIMPLS</h5>
<p>This variable contains a list of yacc source files. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<h5><a name="4-2-115"></a>YACCOBJECTS</h5>
<p>This variable contains a list of yacc object files. The value of this variable is typically handled by <em>qmake</em> or <a href="qmake-manual-8.html#QMAKESPEC">qmake.conf</a> and rarely needs to be modified.</p>
<a name="Functions"></a><h3><a name="5"></a>Functions</h3>
<p><em>qmake</em> recognizes the following functions:</p>
<h4><a name="5-1"></a>include( filename )</h4>
<p>This function will include the contents of <em>filename</em> into the current project at the point where was included. The function succeeds if <em>filename</em> was included, otherwise it fails. You can check the return value of this function using a scope.</p>
<p>For example:</p>
<pre>
include( shared.pri )
OPTIONS = standard custom
!include( options.pri ) {
message( "No custom build options specified" )
OPTIONS -= custom
}
</pre>
<h4><a name="5-2"></a>exists( file )</h4>
<p>This function will test if <em>file</em> exists. If the file exists, then it will succeed; otherwise it will fail. You can specify a regular expression in file and it will succeed if any file matches the regular expression specified.</p>
<p>For example:</p>
<pre>
exists( $(QTDIR)/lib/libtqt-mt* ) {
message( "Configuring for multi-threaded TQt..." )
CONFIG += thread
}
</pre>
<h4><a name="5-3"></a>contains( variablename, value )</h4>
<p>This function will succeed if the variable <em>variablename</em> contains the value <em>value</em>. You can check the return value of this function using a scope.</p>
<p>For example:</p>
<pre>
contains( drivers, network ) {
# drivers contains 'network'
message( "Configuring for network build..." )
HEADERS += network.h
SOURCES += network.cpp
}
</pre>
<h4><a name="5-4"></a>count( variablename, number )</h4>
<p>This function will succeed if the variable <em>variablename</em> contains <em>number</em> elements, otherwise it will fail. You can check the return value of this function using a scope.</p>
<p>For example:</p>
<pre>
MYVAR = one two three
count( MYVAR, 3 ) {
# always true
}
</pre>
<h4><a name="5-5"></a>infile( filename, var, val )</h4>
<p>This function will succeed if the file <em>filename</em> (when parsed by qmake itself) contains the variable <em>var</em> with a value of <em>val</em>. You may also not pass in a third argument (<em>val</em>) and the function will only test if <em>var</em> has been assigned to in the file.</p>
<h4><a name="5-6"></a>isEmpty( variablename )</h4>
<p>This function will succeed if the variable <em>variablename</em> is empty (same as <tt>count(variable, 0)</tt>).</p>
<h4><a name="5-7"></a>system( command )</h4>
<p>This function will execute <tt>command</tt> in a secondary shell and will succeed if the command exits with an exit status of 1. You can check the return value of this function using a scope.</p>
<p>For example:</p>
<pre>
system(ls /bin):HAS_BIN=FALSE
</pre>
<h4><a name="5-8"></a>message( string )</h4>
<p>This function will always succeed, and will display the given <em>string</em> to the user.</p>
<h4><a name="5-9"></a>error( string )</h4>
<p>This function will never return a value. It will display the given <em>string</em> to the user, and then exit <em>qmake</em>. This function should only be used for very fatal configurations.</p>
<p>For example:</p>
<pre>
release:debug:error(You can't have release and debug at the same time!)
</pre>
<a name="Properties"></a><h3><a name="6"></a>Properties</h3>
<p><em>qmake</em> has a system of persistant information, this allows you to 'set' a variable in qmake once, and each time qmake is invoked this value can be queried. Use the following to set a property in qmake:</p>
<pre>
qmake -set VARIABLE VALUE
</pre>
<p>To retrieve this information back from qmake you can do:</p>
<pre>
qmake -query VARIABLE
qmake -query #queries all current VARIABLE/VALUE pairs..
</pre>
<p>This information will be saved into a TQSettings object (meaning it will be stored in different places for different platforms). As VARIABLE is versioned as well, you can set one value in an older version of qmake, and newer versions will retrieve this value, however if you -set VARIABLE into a newer version of qmake the older version will not use this value. You can however query a specific version of a variable if you prefix that version of qmake to VARIABLE, as in:</p>
<pre>
qmake -query "1.06a/VARIABLE"
</pre>
<p>qmake also has the notion of 'builtin' properties, for example you can query the installation of TQt for this version of qmake with the QT_INSTALL_PREFIX property:</p>
<pre>
qmake -query "QT_INSTALL_PREFIX"
</pre>
<p>These builtin properties cannot have a version prefixed to them as they are not versioned and each qmake will have its own notion of these values. The list below outlines the builtin properties:</p>
<ul><li><p>QT_INSTALL_PREFIX - Where the version of TQt this qmake is built for resides</p>
<li><p>QT_INSTALL_DATA - Where data for this version of TQt resides</p>
<li><p>QMAKE_VERSION - The current version of qmake</p>
</ul><p>Finally, these values can be queried in a project file with a special notation such as:</p>
<pre>
QMAKE_VERS = $$[QMAKE_VERSION]
</pre>
<a name="Environment"></a><h3><a name="7"></a>Environment Variables and Configuration</h3>
<a name="QMAKESPEC"></a><h4><a name="7-1"></a>QMAKESPEC</h4>
<p><em>qmake</em> retquires a platform and compiler description file which contains many default values used to generate appropriate makefiles. The standard TQt distribution comes with many of these files, located in the 'mkspecs' subdirectory of the TQt installation.</p>
<p>The QMAKESPEC environment variable can contain any of the following:</p>
<ul><li><p>A complete path to a directory containing a qmake.conf file. In this case <em>qmake</em> will open the qmake.conf file from within that directory. If the file does not exist, <em>qmake</em> will exit with an error.</p>
<li><p>The name of a platform-compiler combination. In this case, <em>qmake</em> will search in the directory specified by the QTDIR environment variable.</p>
</ul><p>Note: the QMAKESPEC path will automatically be added to the <a href="qmake-manual-8.html#INCLUDEPATH">INCLUDEPATH</a> system variable.</p>
<a name="INSTALLS"></a><h4><a name="7-2"></a>INSTALLS</h4>
<p>It is common on UNIX to be able to install from the same utility as you build with (e.g make install). For this <em>qmake</em> has introduce the concept of an install set. The notation for this is quite simple, first you fill in an "object" in qmake for example:</p>
<pre>
documentation.path = /usr/local/program/doc
documentation.files = docs/*
</pre>
<p>In this way you are telling <em>qmake</em> several things about this install, first that you plan to install to /usr/local/program/doc (the path member), second that you plan to copy everything in the docs directory. Once this is done you may insert it in the install list:</p>
<pre>
INSTALLS += documentation
</pre>
<p>Now <em>qmake</em> will take over making sure the correct things are copied to the specified places. If however you retquire greater control you may use the 'extra' member of the object:</p>
<pre>
unix:documentation.extra = create_docs; mv master.doc toc.doc
</pre>
<p>Then qmake will run the things in extra (this is of course platform specific, so you may need to test for your platform first, this case we test for unix). Then it will do the normal processings of the files member. Finally if you appened a builtin install to INSTALLS <em>qmake</em> (and do not specify a files or extra member) will decide what needs to be copied for you, currently the only supported builtin is target:</p>
<pre>
target.path = /usr/local/myprogram
INSTALLS += target
</pre>
<p>With this <em>qmake</em> will know what you plan need copied, and do this for you.</p>
<a name="cache"></a><h4><a name="7-3"></a>Cache File</h4>
<p>The cache file (mentioned above in the options) is a special file <em>qmake</em> will read to find settings not specified in the <tt>qmake.conf</tt> file, the .pro file, or the command line. If <tt>-nocache</tt> is not specified, <em>qmake</em> will try to find a file called <tt>.qmake.cache</tt> in parent directories. If it fails to find this file, it will silently ignore this step of processing.</p>
<a name="LibDepend"></a><h4><a name="7-4"></a>Library Dependencies</h4>
<p>Often when linking against a library <em>qmake</em> relies on the underlying platform to know what other libraries this library links against, and lets the platform pull them in. In many cases, however, this is not sufficent. For example when statically linking a library there are no libraries linked against, and therefore no dependencies to those libraries are created - however an application that later links against this library will need to know where to find the symbols that the linked in library will retquire. To help with this situation <em>qmake</em> will follow a library's dependencies when it feels appropriate, however this behaviour must be enabled in <em>qmake</em>. To enable retquires two steps. First, you must enable it in the library - to do this you must tell <em>qmake</em> to save information about this library:</p>
<pre>
CONFIG += create_prl
</pre>
<p>This is only relevant to the lib template, and will be ignored for all others. When this option is enabled <em>qmake</em> will create a file (called a .prl file) which will save some meta information about the library. This metafile is itself just a qmake project file, but with all internal variables. You are free to view this file, and if deleted <em>qmake</em> will know to recreate it when necesary (either when the .pro file is later read, or if a dependent library (described below) has changed). When installing this library (by using target in INSTALLS, above) <em>qmake</em> will automatically copy the .prl file to your install path.</p>
<p>The second step to enabling this processing is to turn on reading of the meta information created above:</p>
<pre>
CONFIG += link_prl
</pre>
<p>When this is turned on <em>qmake</em> will process all libraries linked to, and find their meta information. With this meta information <em>qmake</em> will figure out what is relevant to linking, specifically it will add to your list of DEFINES as well as LIBS. Once <em>qmake</em> has processed this file, it will then look through the newly introduced LIBS and find their dependent .prl files, and continue until all libraries have been resolved. At this point the makefile is created as usual, and the libraries are linked explicity against your program.</p>
<p>The internals of the .prl file are left closed so they can easily change later. It is not designed to be changed by hand however, and should only be created by <em>qmake</em> - these .prl files should also not be transfered from operating system to operating system as they may be platform dependent (like a makefile).</p>
<a name="Extensions"></a><h4><a name="7-5"></a>File Extensions</h4>
<p>Under normal circumstances <em>qmake</em> will try to use appropriate file extensions for your platform. There may be times, however, that you would like to override the behavior of these extensions. To do this, you must modify builtin variables in your .pro file, which will in turn changes <em>qmake</em>'s interpretation of these files. You may do this as:</p>
<pre>
QMAKE_EXT_MOC = .mymoc
</pre>
<p>The variables are as follows:</p>
<ul><li><p>QMAKE_EXT_MOC - This modifies the extension placed on included moc files.</p>
<li><p>QMAKE_EXT_UI - This modifies the extension used for designer UI files (usually in FORMS).</p>
<li><p>QMAKE_EXT_PRL - This modifies the extension placed on <a href="qmake-manual-8.html#LibDepend">library dependency files</a>.</p>
<li><p>QMAKE_EXT_LEX - This changes the suffix used in files (usually in LEXSOURCES).</p>
<li><p>QMAKE_EXT_YACC - This changes the suffix used in files (usually in YACCSOURCES).</p>
<li><p>QMAKE_EXT_OBJ - This changes the suffix used on generated object files.</p>
</ul><p>All the above accept just the first value, so you must assign to it one value that will be used through your makefile. There are two variables that accept a list of values, they are:</p>
<ul><li><p>QMAKE_EXT_CPP - Changes interpretation all files with these suffixes to be C++ source files.</p>
<li><p>QMAKE_EXT_H - Changes interpretation all files with these suffixes to be C header files.</p>
</ul><a name="Customizing"></a><h4><a name="7-6"></a>Customizing Makefile Output</h4>
<p>qmake often tries to be all things to all build tools, this is often less than ideal when you really need to run special platform dependent commands. This can be achieved with specific instructions to the different qmake backends (currently this is only supported by the UNIX <a href="qmake-manual-8.html#MAKEFILE_GENERATOR">generator</a>).</p>
<p>The interfaces to customizing the Makefile are done through "objects" as in other places in qmake. The notation for this is quite simple, first you fill in an "object" in qmake for example:</p>
<pre>
mytarget.target = .buildfile
mytarget.commands = touch $$mytarget.target
mytarget.depends = mytarget2
mytarget2.commands = @echo Building $$mytarget.target
</pre>
<p>The information above defines a qmake target called mytarget which contains a Makefile target called .buildfile, .buildfile is generated by 'touch .buildfile', and finally that this Makefile target depends on the qmake target mytarget2. Additionally we've defined the qmake target mytarget2 which simply echo's something to stdout.</p>
<p>The final step to making use of the above is to instruct qmake that this is actually an object used by the target building parts of qmake by:</p>
<pre>
QMAKE_EXTRA_UNIX_TARGETS += mytarget mytarget2
</pre>
<p>This is all you need to do to actually build custom targets in qmake, of course you may want to tie one of these targets to actually building the <a href="qmake-manual-8.html#TARGET">qmake build target</a>. To do this, you simply need to include your Makefile target in the list of <a href="qmake-manual-8.html#PRE_TARGETDEPS">PRE_TARGETDEPS</a>.</p>
<p>For convenience there is also a method of customizing (UNIX) projects for generic new compilers (or even preprocessors).</p>
<pre>
new_moc.output = moc_${QMAKE_FILE_BASE}.cpp
new_moc.commands = moc ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
new_moc.depends = g++ -E -M ${QMAKE_FILE_NAME} | sed "s,^.*: ,,"
new_moc.input = NEW_HEADERS
QMAKE_EXTRA_UNIX_COMPILERS += new_moc
</pre>
<p>With this you can create a new moc for qmake, the commands will be executed over all arguments given to a NEW_HEADERS variable (from the input variable), and write to output (and automatically hand this filename to the compiler to be linked into your target). Additionally qmake will execute depends to generate dependency information and place this in the project as well.</p>
<p>These commands can easily be placed into a cache file, and subsequent .pro files can give several arguments to NEW_HEADERS.</p>
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>
|