summaryrefslogtreecommitdiff
path: root/SCons/Tool/qt.xml
blob: 5298a82c439e69bc4dbb676ed6a6acf6b4242a34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
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
<?xml version="1.0"?>
<!--
__COPYRIGHT__

This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
<!ENTITY % scons SYSTEM '../../doc/scons.mod'>
%scons;
<!ENTITY % builders-mod SYSTEM '../../doc/generated/builders.mod'>
%builders-mod;
<!ENTITY % functions-mod SYSTEM '../../doc/generated/functions.mod'>
%functions-mod;
<!ENTITY % tools-mod SYSTEM '../../doc/generated/tools.mod'>
%tools-mod;
<!ENTITY % variables-mod SYSTEM '../../doc/generated/variables.mod'>
%variables-mod;
]>

<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">

<tool name="qt">
<summary>
<para>
Sets &consvars; for building Qt3 applications.
</para>

<note><para>
This tool is only suitable for building targeted to Qt3,
which is obsolete
(<emphasis>the tool is deprecated since 4.3</emphasis>).
There are contributed tools for Qt4 and Qt5, see
<ulink url="https://github.com/SCons/scons-contrib">
https://github.com/SCons/scons-contrib</ulink>.
Qt4 has also passed end of life for standard support (in Dec 2015).
</para></note>

<para>
Note paths for these &consvars; are assembled
using the <function>os.path.join</function> method
so they will have the appropriate separator at runtime,
but are listed here in the various
entries only with the <literal>'/'</literal> separator
for simplicity.
</para>

<para>
In addition, the &consvars;
&cv-link-CPPPATH;,
&cv-link-LIBPATH; and
&cv-link-LIBS; may be modified
and the variables
&cv-link-PROGEMITTER;, &cv-link-SHLIBEMITTER; and &cv-link-LIBEMITTER;
are modified. Because the build-performance is affected when using this tool,
you have to explicitly specify it at Environment creation:
</para>

<example_commands>
Environment(tools=['default','qt'])
</example_commands>

<para>
The &t-qt; tool supports the following operations:
</para>

<para>
<emphasis role="strong">Automatic moc file generation from header files.</emphasis>
You do not have to specify moc files explicitly, the tool does it for you.
However, there are a few preconditions to do so: Your header file must have
the same filebase as your implementation file and must stay in the same
directory. It must have one of the suffixes
<filename>.h</filename>,
<filename>.hpp</filename>,
<filename>.H</filename>,
<filename>.hxx</filename>,
<filename>.hh</filename>.
You can turn off automatic moc file generation by setting
&cv-link-QT_AUTOSCAN; to <constant>False</constant>.
See also the corresponding
&b-link-Moc; Builder.
</para>

<para>
<emphasis role="strong">Automatic moc file generation from C++ files.</emphasis>
As described in the Qt documentation, include the moc file at the end of
the C++ file. Note that you have to include the file, which is generated
by the transformation
<literal>${QT_MOCCXXPREFIX}&lt;basename&gt;${QT_MOCCXXSUFFIX}</literal>, by default
<filename>&lt;basename&gt;.mo</filename>. A warning is generated after building the moc file if you
do not include the correct file. If you are using &f-link-VariantDir;, you may
need to specify <parameter>duplicate=True</parameter>.
You can turn off automatic moc file generation by setting &cv-QT_AUTOSCAN; to
<literal>False</literal>. See also the corresponding
&b-link-Moc; Builder.
</para>

<para>
<emphasis role="strong">Automatic handling of .ui files.</emphasis>
The implementation files generated from <filename>.ui</filename>
files are handled much the same as yacc or lex files.
Each <command>.ui</command> file given as a source of &b-link-Program;,
&b-link-Library; or &b-link-SharedLibrary;
will generate three files: the declaration file, the
implementation file and a moc file. Because there are also generated headers,
you may need to specify <parameter>duplicate=True</parameter> in calls to
&f-link-VariantDir;.
See also the corresponding
&b-link-Uic; Builder.
</para>
</summary>
<sets>
<item>QTDIR</item>
<item>QT_BINPATH</item>
<item>QT_CPPPATH</item>
<item>QT_LIBPATH</item>
<item>QT_MOC</item>
<item>QT_UIC</item>
<item>QT_LIB</item>
<item>QT_AUTOSCAN</item>
<item>QT_UICIMPLFLAGS</item>
<item>QT_UICDECLFLAGS</item>
<item>QT_MOCFROMHFLAGS</item>
<item>QT_MOCFROMCXXFLAGS</item>
<item>QT_UICDECLPREFIX</item>
<item>QT_UICDECLSUFFIX</item>
<item>QT_UICIMPLPREFIX</item>
<item>QT_UICIMPLSUFFIX</item>
<item>QT_MOCHPREFIX</item>
<item>QT_MOCHSUFFIX</item>
<item>QT_MOCCXXPREFIX</item>
<item>QT_MOCCXXSUFFIX</item>
<item>QT_UISUFFIX</item>
<item>QT_UICCOM</item>
<item>QT_MOCFROMHCOM</item>
<item>QT_MOCFROMCXXCOM</item>
</sets>
<uses>
<item>QTDIR</item>
</uses>
</tool>

<builder name="Moc">
<summary>
<para>
Builds an output file from a <command>moc</command> input file.
<command>moc</command> input files are either header files or C++ files.
This builder is only available after using the
tool &t-link-qt;. See the &cv-link-QTDIR; variable for more information.
Example:
</para>

<example_commands>
env.Moc('foo.h')  # generates moc_foo.cc
env.Moc('foo.cpp')  # generates foo.moc
</example_commands>
</summary>
</builder>

<builder name="Uic">
<summary>
<para>
Builds a header file, an implementation file and a moc file from an ui file.
and returns the corresponding nodes in the that order.
This builder is only available after using the tool &t-link-qt;.
Note: you can specify <filename>.ui</filename> files directly as source
files to the &b-link-Program;,
&b-link-Library; and &b-link-SharedLibrary; builders
without using this builder. Using this builder lets you override the standard
naming conventions (be careful: prefixes are always prepended to names of
built files; if you don't want prefixes, you may set them to ``).
See the &cv-link-QTDIR; variable for more information.
Example:
</para>

<example_commands>
env.Uic('foo.ui')  # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc']
env.Uic(
    target=Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'),
    source='foo.ui'
)  # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc']
</example_commands>
</summary>
</builder>

<cvar name="QTDIR">
<summary>
<para>
The path to the Qt installation to build against.
If not already set,
&t-link-qt; tool tries to obtain this from
<varname>os.environ</varname>;
if not found there, it tries to make a guess.
</para>
</summary>
</cvar>

<cvar name="QT_AUTOSCAN">
<summary>
<para>
Turn off scanning for mocable files. Use the &b-link-Moc; Builder to explicitly
specify files to run <command>moc</command> on.
</para>
</summary>
</cvar>

<cvar name="QT_BINPATH">
<summary>
<para>
The path where the Qt binaries are installed.
The default value is '&cv-link-QTDIR;<filename>/bin</filename>'.
</para>
</summary>
</cvar>

<cvar name="QT_CPPPATH">
<summary>
<para>
The path where the Qt header files are installed.
The default value is '&cv-link-QTDIR;/include'.
Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-CPPPATH;
construction variable.
</para>
</summary>
</cvar>

<cvar name="QT_DEBUG">
<summary>
<para>
Prints lots of debugging information while scanning for moc files.
</para>
</summary>
</cvar>

<cvar name="QT_LIB">
<summary>
<para>
Default value is <literal>'qt'</literal>.
You may want to set this to <literal>'qt-mt'</literal>.
Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-LIBS; variable.
</para>
</summary>
</cvar>

<cvar name="QT_LIBPATH">
<summary>
<para>
The path where the Qt libraries are installed.
The default value is '&cv-link-QTDIR;<filename>/lib</filename>'.
Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-LIBPATH;
construction variable.
</para>
</summary>
</cvar>

<cvar name="QT_MOC">
<summary>
<para>
Default value is '&cv-link-QT_BINPATH;<filename>/moc</filename>'.
</para>
</summary>
</cvar>

<cvar name="QT_MOCCXXPREFIX">
<summary>
<para>
Default value is <literal>''</literal>.
Prefix for <command>moc</command> output files when source is a C++ file.
</para>
</summary>
</cvar>

<cvar name="QT_MOCCXXSUFFIX">
<summary>
<para>
Default value is <literal>'.moc'</literal>.
Suffix for <command>moc</command> output files when source is a C++ file.
</para>
</summary>
</cvar>

<cvar name="QT_MOCFROMCXXFLAGS">
<summary>
<para>
Default value is <literal>'-i'</literal>.
These flags are passed to <command>moc</command> when moccing a C++ file.
</para>
</summary>
</cvar>

<cvar name="QT_MOCFROMCXXCOM">
<summary>
<para>
Command to generate a moc file from a C++ file.
</para>
</summary>
</cvar>

<cvar name="QT_MOCFROMCXXCOMSTR">
<summary>
<para>
The string displayed when generating a moc file from a C++ file.
If this is not set, then &cv-link-QT_MOCFROMCXXCOM; (the command line) is displayed.
</para>
</summary>
</cvar>

<cvar name="QT_MOCFROMHCOM">
<summary>
<para>
Command to generate a moc file from a header.
</para>
</summary>
</cvar>

<cvar name="QT_MOCFROMHCOMSTR">
<summary>
<para>
The string displayed when generating a moc file from a C++ file.
If this is not set, then &cv-link-QT_MOCFROMHCOM; (the command line) is displayed.
</para>
</summary>
</cvar>

<cvar name="QT_MOCFROMHFLAGS">
<summary>
<para>
Default value is <literal>''</literal>. These flags are passed to <command>moc</command>
when moccing a header file.
</para>
</summary>
</cvar>

<cvar name="QT_MOCHPREFIX">
<summary>
<para>
Default value is <literal>'moc_'</literal>.
Prefix for <command>moc</command> output files when source is a header.
</para>
</summary>
</cvar>

<cvar name="QT_MOCHSUFFIX">
<summary>
<para>
Default value is '&cv-link-CXXFILESUFFIX;'.
Suffix for moc output files when source is a header.
</para>
</summary>
</cvar>

<cvar name="QT_UIC">
<summary>
<para>
Default value is '&cv-link-QT_BINPATH;<filename>/uic</filename>'.
</para>
</summary>
</cvar>

<cvar name="QT_UICCOM">
<summary>
<para>
Command to generate header files from <filename>.ui</filename> files.
</para>
</summary>
</cvar>

<cvar name="QT_UICCOMSTR">
<summary>
<para>
The string displayed when generating header files from <filename>.ui</filename> files.
If this is not set, then &cv-link-QT_UICCOM; (the command line) is displayed.
</para>
</summary>
</cvar>

<cvar name="QT_UICDECLFLAGS">
<summary>
<para>
Default value is ''. These flags are passed to <command>uic</command>
when creating a header file from a <filename>.ui</filename> file.
</para>
</summary>
</cvar>

<cvar name="QT_UICDECLPREFIX">
<summary>
<para>
Default value is <literal>''</literal>.
Prefix for <command>uic</command> generated header files.
</para>
</summary>
</cvar>

<cvar name="QT_UICDECLSUFFIX">
<summary>
<para>
Default value is <literal>'.h'</literal>.
Suffix for <command>uic</command> generated header files.
</para>
</summary>
</cvar>

<cvar name="QT_UICIMPLFLAGS">
<summary>
<para>
Default value is <literal>''</literal>.
These flags are passed to <command>uic</command> when creating a C++
file from a <filename>.ui</filename> file.
</para>
</summary>
</cvar>

<cvar name="QT_UICIMPLPREFIX">
<summary>
<para>
Default value is <literal>'uic_'</literal>.
Prefix for uic generated implementation files.
</para>
</summary>
</cvar>

<cvar name="QT_UICIMPLSUFFIX">
<summary>
<para>
Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for uic generated implementation
files.
</para>
</summary>
</cvar>

<cvar name="QT_UISUFFIX">
<summary>
<para>
Default value is <literal>'.ui'</literal>.
Suffix of designer input files.
</para>
</summary>
</cvar>

</sconsdoc>