5 This file is processed by the bin/SConsDoc.py module.
6 See its __doc__ string for a discussion of the format.
10 <!ENTITY % scons SYSTEM '../../doc/scons.mod'>
12 <!ENTITY % builders-mod SYSTEM '../../doc/generated/builders.mod'>
14 <!ENTITY % functions-mod SYSTEM '../../doc/generated/functions.mod'>
16 <!ENTITY % tools-mod SYSTEM '../../doc/generated/tools.mod'>
18 <!ENTITY % variables-mod SYSTEM '../../doc/generated/variables.mod'>
22 <sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
23 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24 xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
29 Sets &consvars; for building Qt3 applications.
33 This tool is only suitable for building targeted to Qt3,
35 (<emphasis>the tool is deprecated since 4.3,
36 and was renamed to qt3 in 4.5.0.
38 There are contributed tools for Qt4 and Qt5, see
39 <ulink url="https://github.com/SCons/scons-contrib">
40 https://github.com/SCons/scons-contrib</ulink>.
41 Qt4 has also passed end of life for standard support (in Dec 2015).
45 Note paths for these &consvars; are assembled
46 using the <function>os.path.join</function> method
47 so they will have the appropriate separator at runtime,
48 but are listed here in the various
49 entries only with the <literal>'/'</literal> separator
54 In addition, the &consvars;
57 &cv-link-LIBS; may be modified
59 &cv-link-PROGEMITTER;, &cv-link-SHLIBEMITTER; and &cv-link-LIBEMITTER;
60 are modified. Because the build-performance is affected when using this tool,
61 you have to explicitly specify it at Environment creation:
65 Environment(tools=['default','qt3'])
69 The &t-qt3; tool supports the following operations:
73 <emphasis role="strong">Automatic moc file generation from header files.</emphasis>
74 You do not have to specify moc files explicitly, the tool does it for you.
75 However, there are a few preconditions to do so: Your header file must have
76 the same filebase as your implementation file and must stay in the same
77 directory. It must have one of the suffixes
78 <filename>.h</filename>,
79 <filename>.hpp</filename>,
80 <filename>.H</filename>,
81 <filename>.hxx</filename>,
82 <filename>.hh</filename>.
83 You can turn off automatic moc file generation by setting
84 &cv-link-QT3_AUTOSCAN; to <constant>False</constant>.
85 See also the corresponding
90 <emphasis role="strong">Automatic moc file generation from C++ files.</emphasis>
91 As described in the Qt documentation, include the moc file at the end of
92 the C++ file. Note that you have to include the file, which is generated
94 <literal>${QT3_MOCCXXPREFIX}<basename>${QT3_MOCCXXSUFFIX}</literal>, by default
95 <filename><basename>.mo</filename>. A warning is generated after building the moc file if you
96 do not include the correct file. If you are using &f-link-VariantDir;, you may
97 need to specify <parameter>duplicate=True</parameter>.
98 You can turn off automatic moc file generation by setting &cv-QT3_AUTOSCAN; to
99 <literal>False</literal>. See also the corresponding
100 &b-link-Moc; Builder.
104 <emphasis role="strong">Automatic handling of .ui files.</emphasis>
105 The implementation files generated from <filename>.ui</filename>
106 files are handled much the same as yacc or lex files.
107 Each <command>.ui</command> file given as a source of &b-link-Program;,
108 &b-link-Library; or &b-link-SharedLibrary;
109 will generate three files: the declaration file, the
110 implementation file and a moc file. Because there are also generated headers,
111 you may need to specify <parameter>duplicate=True</parameter> in calls to
113 See also the corresponding
114 &b-link-Uic; Builder.
119 <item>QT3_BINPATH</item>
120 <item>QT3_CPPPATH</item>
121 <item>QT3_LIBPATH</item>
125 <item>QT3_AUTOSCAN</item>
126 <item>QT3_UICIMPLFLAGS</item>
127 <item>QT3_UICDECLFLAGS</item>
128 <item>QT3_MOCFROMHFLAGS</item>
129 <item>QT3_MOCFROMCXXFLAGS</item>
130 <item>QT3_UICDECLPREFIX</item>
131 <item>QT3_UICDECLSUFFIX</item>
132 <item>QT3_UICIMPLPREFIX</item>
133 <item>QT3_UICIMPLSUFFIX</item>
134 <item>QT3_MOCHPREFIX</item>
135 <item>QT3_MOCHSUFFIX</item>
136 <item>QT3_MOCCXXPREFIX</item>
137 <item>QT3_MOCCXXSUFFIX</item>
138 <item>QT3_UISUFFIX</item>
139 <item>QT3_UICCOM</item>
140 <item>QT3_MOCFROMHCOM</item>
141 <item>QT3_MOCFROMCXXCOM</item>
151 Builds an output file from a <command>moc</command> input file.
152 <command>moc</command> input files are either header files or C++ files.
153 This builder is only available after using the
154 tool &t-link-qt3;. See the &cv-link-QT3DIR; variable for more information.
159 env.Moc('foo.h') # generates moc_foo.cc
160 env.Moc('foo.cpp') # generates foo.moc
168 Builds a header file, an implementation file and a moc file from an ui file.
169 and returns the corresponding nodes in the that order.
170 This builder is only available after using the tool &t-link-qt3;.
171 Note: you can specify <filename>.ui</filename> files directly as source
172 files to the &b-link-Program;,
173 &b-link-Library; and &b-link-SharedLibrary; builders
174 without using this builder. Using this builder lets you override the standard
175 naming conventions (be careful: prefixes are always prepended to names of
176 built files; if you don't want prefixes, you may set them to ``).
177 See the &cv-link-QT3DIR; variable for more information.
182 env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc']
184 target=Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'),
186 ) # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc']
194 The path to the Qt installation to build against.
196 &t-link-qt3; tool tries to obtain this from
197 <varname>os.environ</varname>;
198 if not found there, it tries to make a guess.
201 <emphasis>Changed in 4.5.0</emphasis>: renamed from QTDIR.
206 <cvar name="QT3_AUTOSCAN">
209 Turn off scanning for mocable files. Use the &b-link-Moc; Builder to explicitly
210 specify files to run <command>moc</command> on.
213 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_AUTOSCAN.
218 <cvar name="QT3_BINPATH">
221 The path where the Qt binaries are installed.
222 The default value is '&cv-link-QT3DIR;<filename>/bin</filename>'.
225 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_BINPATH.
230 <cvar name="QT3_CPPPATH">
233 The path where the Qt header files are installed.
234 The default value is '&cv-link-QT3DIR;/include'.
235 Note: If you set this variable to <constant>None</constant>,
236 the tool won't change the &cv-link-CPPPATH;
237 construction variable.
240 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_CPPPATH.
245 <cvar name="QT3_DEBUG">
248 Prints lots of debugging information while scanning for moc files.
251 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_DEBUG.
256 <cvar name="QT3_LIB">
259 Default value is <literal>'qt'</literal>.
260 You may want to set this to <literal>'qt-mt'</literal>.
261 Note: If you set this variable to <constant>None</constant>,
262 the tool won't change the &cv-link-LIBS; variable.
265 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_LIB.
270 <cvar name="QT3_LIBPATH">
273 The path where the Qt libraries are installed.
274 The default value is '&cv-link-QT3DIR;<filename>/lib</filename>'.
275 Note: If you set this variable to <constant>None</constant>,
276 the tool won't change the &cv-link-LIBPATH;
277 construction variable.
280 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_LIBPATH.
285 <cvar name="QT3_MOC">
288 Default value is '&cv-link-QT3_BINPATH;<filename>/moc</filename>'.
293 <cvar name="QT3_MOCCXXPREFIX">
296 Default value is <literal>''</literal>.
297 Prefix for <command>moc</command> output files when source is a C++ file.
302 <cvar name="QT3_MOCCXXSUFFIX">
305 Default value is <literal>'.moc'</literal>.
306 Suffix for <command>moc</command> output files when source is a C++ file.
309 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCCXXSUFFIX.
314 <cvar name="QT3_MOCFROMCXXFLAGS">
317 Default value is <literal>'-i'</literal>.
318 These flags are passed to <command>moc</command> when moccing a C++ file.
321 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMCXXFLAGS.
326 <cvar name="QT3_MOCFROMCXXCOM">
329 Command to generate a moc file from a C++ file.
332 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMCXXCOM.
337 <cvar name="QT3_MOCFROMCXXCOMSTR">
340 The string displayed when generating a moc file from a C++ file.
341 If this is not set, then &cv-link-QT3_MOCFROMCXXCOM; (the command line) is displayed.
344 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMCXXCOMSTR.
349 <cvar name="QT3_MOCFROMHCOM">
352 Command to generate a moc file from a header.
355 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMSHCOM.
360 <cvar name="QT3_MOCFROMHCOMSTR">
363 The string displayed when generating a moc file from a C++ file.
364 If this is not set, then &cv-link-QT3_MOCFROMHCOM; (the command line) is displayed.
367 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMSHCOMSTR.
372 <cvar name="QT3_MOCFROMHFLAGS">
375 Default value is <literal>''</literal>. These flags are passed to <command>moc</command>
376 when moccing a header file.
379 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCFROMSHFLAGS.
384 <cvar name="QT3_MOCHPREFIX">
387 Default value is <literal>'moc_'</literal>.
388 Prefix for <command>moc</command> output files when source is a header.
391 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCHPREFIX.
396 <cvar name="QT3_MOCHSUFFIX">
399 Default value is '&cv-link-CXXFILESUFFIX;'.
400 Suffix for moc output files when source is a header.
403 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_MOCHSUFFIX.
408 <cvar name="QT3_UIC">
411 Default value is '&cv-link-QT3_BINPATH;<filename>/uic</filename>'.
414 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UIC.
419 <cvar name="QT3_UICCOM">
422 Command to generate header files from <filename>.ui</filename> files.
425 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICCOM.
430 <cvar name="QT3_UICCOMSTR">
433 The string displayed when generating header files from <filename>.ui</filename> files.
434 If this is not set, then &cv-link-QT3_UICCOM; (the command line) is displayed.
437 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICCOMSTR.
442 <cvar name="QT3_UICDECLFLAGS">
445 Default value is ''. These flags are passed to <command>uic</command>
446 when creating a header file from a <filename>.ui</filename> file.
449 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICDECLFLAGS.
454 <cvar name="QT3_UICDECLPREFIX">
457 Default value is <literal>''</literal>.
458 Prefix for <command>uic</command> generated header files.
461 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICDECLPREFIX.
466 <cvar name="QT3_UICDECLSUFFIX">
469 Default value is <literal>'.h'</literal>.
470 Suffix for <command>uic</command> generated header files.
473 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICDECLSUFFIX.
478 <cvar name="QT3_UICIMPLFLAGS">
481 Default value is <literal>''</literal>.
482 These flags are passed to <command>uic</command> when creating a C++
483 file from a <filename>.ui</filename> file.
486 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICIMPFLAGS.
491 <cvar name="QT3_UICIMPLPREFIX">
494 Default value is <literal>'uic_'</literal>.
495 Prefix for uic generated implementation files.
498 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICIMPLPREFIX.
503 <cvar name="QT3_UICIMPLSUFFIX">
506 Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for uic generated implementation
510 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UICIMPLSUFFIX.
515 <cvar name="QT3_UISUFFIX">
518 Default value is <literal>'.ui'</literal>.
519 Suffix of designer input files.
522 <emphasis>Changed in 4.5.0</emphasis>: renamed from QT_UISUFFIX.