summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2023-02-23 15:30:59 -0800
committerWilliam Deegan <bill@baddogconsulting.com>2023-02-23 15:30:59 -0800
commitf8c2a438f82eddd270dbe29a637fd3c76a0f9263 (patch)
treed74088a96091053c5d58d04569910527ded4ba7c
parent55b490b385948577a4a3a2338e48caa28780f6c7 (diff)
downloadscons-git-f8c2a438f82eddd270dbe29a637fd3c76a0f9263.tar.gz
move qt -> qt3 tool, adjust testing as well
-rw-r--r--SCons/Tool/qt3.py (renamed from SCons/Tool/qt.py)164
-rw-r--r--SCons/Tool/qt3.xml (renamed from SCons/Tool/qt.xml)138
-rw-r--r--test/QT/qt3/CPPPATH-appended.py (renamed from test/QT/CPPPATH-appended.py)0
-rw-r--r--test/QT/qt3/CPPPATH.py (renamed from test/QT/CPPPATH.py)0
-rw-r--r--test/QT/qt3/QTFLAGS.py (renamed from test/QT/QTFLAGS.py)0
-rw-r--r--test/QT/qt3/Tool.py (renamed from test/QT/Tool.py)0
-rw-r--r--test/QT/qt3/copied-env.py (renamed from test/QT/copied-env.py)2
-rw-r--r--test/QT/qt3/empty-env.py (renamed from test/QT/empty-env.py)0
-rw-r--r--test/QT/qt3/generated-ui.py (renamed from test/QT/generated-ui.py)0
-rw-r--r--test/QT/qt3/installed.py (renamed from test/QT/installed.py)0
-rw-r--r--test/QT/qt3/manual.py (renamed from test/QT/manual.py)0
-rw-r--r--test/QT/qt3/moc-from-cpp.py (renamed from test/QT/moc-from-cpp.py)0
-rw-r--r--test/QT/qt3/moc-from-header.py (renamed from test/QT/moc-from-header.py)0
-rw-r--r--test/QT/qt3/qt_warnings.py (renamed from test/QT/qt_warnings.py)0
-rw-r--r--test/QT/qt3/reentrant.py (renamed from test/QT/reentrant.py)0
-rw-r--r--test/QT/qt3/source-from-ui.py (renamed from test/QT/source-from-ui.py)0
-rw-r--r--test/QT/qt3/up-to-date.py (renamed from test/QT/up-to-date.py)0
-rw-r--r--testing/framework/TestSCons.py10
18 files changed, 159 insertions, 155 deletions
diff --git a/SCons/Tool/qt.py b/SCons/Tool/qt3.py
index ff995657d..2b315548e 100644
--- a/SCons/Tool/qt.py
+++ b/SCons/Tool/qt3.py
@@ -59,21 +59,21 @@ if SCons.Util.case_sensitive_suffixes('.h', '.H'):
cxx_suffixes = cplusplus.CXXSuffixes
-def find_platform_specific_qt_paths():
+def find_platform_specific_qt3_paths():
"""
find non-standard QT paths
If the platform does not put QT tools in standard search paths,
- the path is expected to be set using QTDIR. SCons violates
+ the path is expected to be set using QT3DIR. SCons violates
the normal rule of not pulling from the user's environment
in this case. However, some test cases try to validate what
- happens when QTDIR is unset, so we need to try to make a guess.
+ happens when QT3DIR is unset, so we need to try to make a guess.
:return: a guess at a path
"""
- # qt_bin_dirs = []
- qt_bin_dir = None
+ # qt3_bin_dirs = []
+ qt3_bin_dir = None
if os.path.isfile('/etc/redhat-release'):
with open('/etc/redhat-release','r') as rr:
lines = rr.readlines()
@@ -81,14 +81,14 @@ def find_platform_specific_qt_paths():
if distro == 'CentOS':
# Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin
# so we need to handle this differently
- # qt_bin_dirs = glob.glob('/usr/lib64/qt*/bin')
+ # qt3_bin_dirs = glob.glob('/usr/lib64/qt*/bin')
# TODO: all current Fedoras do the same, need to look deeper here.
- qt_bin_dir = '/usr/lib64/qt-3.3/bin'
+ qt3_bin_dir = '/usr/lib64/qt-3.3/bin'
- return qt_bin_dir
+ return qt3_bin_dir
-QT_BIN_DIR = find_platform_specific_qt_paths()
+QT3_BIN_DIR = find_platform_specific_qt3_paths()
def checkMocIncluded(target, source, env):
moc = target[0]
@@ -122,15 +122,15 @@ class _Automoc:
def __call__(self, target, source, env):
"""
Smart autoscan function. Gets the list of objects for the Program
- or Lib. Adds objects and builders for the special qt files.
+ or Lib. Adds objects and builders for the special qt3 files.
"""
try:
- if int(env.subst('$QT_AUTOSCAN')) == 0:
+ if int(env.subst('$QT3_AUTOSCAN')) == 0:
return target, source
except ValueError:
pass
try:
- debug = int(env.subst('$QT_DEBUG'))
+ debug = int(env.subst('$QT3_DEBUG'))
except ValueError:
debug = 0
@@ -159,17 +159,17 @@ class _Automoc:
if not obj.has_builder():
# binary obj file provided
if debug:
- print("scons: qt: '%s' seems to be a binary. Discarded." % str(obj))
+ print("scons: qt3: '%s' seems to be a binary. Discarded." % str(obj))
continue
cpp = obj.sources[0]
if not splitext(str(cpp))[1] in cxx_suffixes:
if debug:
- print("scons: qt: '%s' is no cxx file. Discarded." % str(cpp))
+ print("scons: qt3: '%s' is no cxx file. Discarded." % str(cpp))
# c or fortran source
continue
#cpp_contents = comment.sub('', cpp.get_text_contents())
if debug:
- print("scons: qt: Getting contents of %s" % cpp)
+ print("scons: qt3: Getting contents of %s" % cpp)
cpp_contents = cpp.get_text_contents()
h=None
for h_ext in header_extensions:
@@ -179,12 +179,12 @@ class _Automoc:
h = find_file(hname, (cpp.get_dir(),), env.File)
if h:
if debug:
- print("scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp)))
+ print("scons: qt3: Scanning '%s' (header of '%s')" % (str(h), str(cpp)))
#h_contents = comment.sub('', h.get_text_contents())
h_contents = h.get_text_contents()
break
if not h and debug:
- print("scons: qt: no header for '%s'." % (str(cpp)))
+ print("scons: qt3: no header for '%s'." % (str(cpp)))
if h and q_object_search.search(h_contents):
# h file with the Q_OBJECT macro found -> add moc_cpp
moc_cpp = env.Moc(h)
@@ -192,14 +192,14 @@ class _Automoc:
out_sources.append(moc_o)
#moc_cpp.target_scanner = SCons.Defaults.CScan
if debug:
- print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp)))
+ print("scons: qt3: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp)))
if cpp and q_object_search.search(cpp_contents):
# cpp file with Q_OBJECT macro found -> add moc
# (to be included in cpp)
moc = env.Moc(cpp)
env.Ignore(moc, moc)
if debug:
- print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)))
+ print("scons: qt3: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)))
#moc.source_scanner = SCons.Defaults.CScan
# restore the original env attributes (FIXME)
objBuilder.env = objBuilderEnv
@@ -210,25 +210,25 @@ class _Automoc:
AutomocShared = _Automoc('SharedObject')
AutomocStatic = _Automoc('StaticObject')
-def _detect(env):
+def _detect_qt3(env):
"""Not really safe, but fast method to detect the QT library"""
- QTDIR = env.get('QTDIR',None)
- if not QTDIR:
- QTDIR = os.environ.get('QTDIR',None)
- if not QTDIR:
- moc = env.WhereIs('moc') or env.WhereIs('moc',QT_BIN_DIR)
+ QT3DIR = env.get('QT3DIR',None)
+ if not QT3DIR:
+ QT3DIR = os.environ.get('QTDIR',None)
+ if not QT3DIR:
+ moc = env.WhereIs('moc') or env.WhereIs('moc',QT3_BIN_DIR)
if moc:
- QTDIR = os.path.dirname(os.path.dirname(moc))
+ QT3DIR = os.path.dirname(os.path.dirname(moc))
SCons.Warnings.warn(
QtdirNotFound,
- "Could not detect qt, using moc executable as a hint (QTDIR=%s)" % QTDIR)
+ "Could not detect qt3, using moc executable as a hint (QT3DIR=%s)" % QT3DIR)
else:
- QTDIR = None
+ QT3DIR = None
SCons.Warnings.warn(
QtdirNotFound,
- "Could not detect qt, using empty QTDIR")
- return QTDIR
+ "Could not detect qt3, using empty QT3DIR")
+ return QT3DIR
def uicEmitter(target, source, env):
adjustixes = SCons.Util.adjustixes
@@ -238,13 +238,13 @@ def uicEmitter(target, source, env):
if len(target) < 2:
# second target is implementation
target.append(adjustixes(bs,
- env.subst('$QT_UICIMPLPREFIX'),
- env.subst('$QT_UICIMPLSUFFIX')))
+ env.subst('$QT3_UICIMPLPREFIX'),
+ env.subst('$QT3_UICIMPLSUFFIX')))
if len(target) < 3:
# third target is moc file
target.append(adjustixes(bs,
- env.subst('$QT_MOCHPREFIX'),
- env.subst('$QT_MOCHSUFFIX')))
+ env.subst('$QT3_MOCHPREFIX'),
+ env.subst('$QT3_MOCHSUFFIX')))
return target, source
def uicScannerFunc(node, env, path):
@@ -266,7 +266,7 @@ uicScanner = SCons.Scanner.ScannerBase(uicScannerFunc,
recursive = 0)
def generate(env):
- """Add Builders and construction variables for qt to an Environment."""
+ """Add Builders and construction variables for qt3 to an Environment."""
CLVar = SCons.Util.CLVar
Action = SCons.Action.Action
Builder = SCons.Builder.Builder
@@ -275,70 +275,74 @@ def generate(env):
SCons.Warnings.ToolQtDeprecatedWarning, "Tool module for Qt version 3 is deprecated"
)
- env.SetDefault(QTDIR = _detect(env),
- QT_BINPATH = os.path.join('$QTDIR', 'bin'),
- QT_CPPPATH = os.path.join('$QTDIR', 'include'),
- QT_LIBPATH = os.path.join('$QTDIR', 'lib'),
- QT_MOC = os.path.join('$QT_BINPATH','moc'),
- QT_UIC = os.path.join('$QT_BINPATH','uic'),
- QT_LIB = 'qt', # may be set to qt-mt
+ qt3path = _detect_qt3(env)
+ if qt3path is None:
+ return None
- QT_AUTOSCAN = 1, # scan for moc'able sources
+ env.SetDefault(QT3DIR = qt3path,
+ QT3_BINPATH = os.path.join('$QT3DIR', 'bin'),
+ QT3_CPPPATH = os.path.join('$QT3DIR', 'include'),
+ QT3_LIBPATH = os.path.join('$QT3DIR', 'lib'),
+ QT3_MOC = os.path.join('$QT3_BINPATH','moc'),
+ QT3_UIC = os.path.join('$QT3_BINPATH','uic'),
+ QT3_LIB = 'qt', # may be set to qt-mt
+
+ QT3_AUTOSCAN = 1, # scan for moc'able sources
# Some QT specific flags. I don't expect someone wants to
# manipulate those ...
- QT_UICIMPLFLAGS = CLVar(''),
- QT_UICDECLFLAGS = CLVar(''),
- QT_MOCFROMHFLAGS = CLVar(''),
- QT_MOCFROMCXXFLAGS = CLVar('-i'),
+ QT3_UICIMPLFLAGS = CLVar(''),
+ QT3_UICDECLFLAGS = CLVar(''),
+ QT3_MOCFROMHFLAGS = CLVar(''),
+ QT3_MOCFROMCXXFLAGS = CLVar('-i'),
# suffixes/prefixes for the headers / sources to generate
- QT_UICDECLPREFIX = '',
- QT_UICDECLSUFFIX = '.h',
- QT_UICIMPLPREFIX = 'uic_',
- QT_UICIMPLSUFFIX = '$CXXFILESUFFIX',
- QT_MOCHPREFIX = 'moc_',
- QT_MOCHSUFFIX = '$CXXFILESUFFIX',
- QT_MOCCXXPREFIX = '',
- QT_MOCCXXSUFFIX = '.moc',
- QT_UISUFFIX = '.ui',
-
- # Commands for the qt support ...
+ QT3_UICDECLPREFIX = '',
+ QT3_UICDECLSUFFIX = '.h',
+ QT3_UICIMPLPREFIX = 'uic_',
+ QT3_UICIMPLSUFFIX = '$CXXFILESUFFIX',
+ QT3_MOCHPREFIX = 'moc_',
+ QT3_MOCHSUFFIX = '$CXXFILESUFFIX',
+ QT3_MOCCXXPREFIX = '',
+ QT3_MOCCXXSUFFIX = '.moc',
+ QT3_UISUFFIX = '.ui',
+
+ # Commands for the qt3 support ...
# command to generate header, implementation and moc-file
# from a .ui file
- QT_UICCOM = [
- CLVar('$QT_UIC $QT_UICDECLFLAGS -o ${TARGETS[0]} $SOURCE'),
- CLVar('$QT_UIC $QT_UICIMPLFLAGS -impl ${TARGETS[0].file} '
+ QT3_UICCOM = [
+ CLVar('$QT3_UIC $QT3_UICDECLFLAGS -o ${TARGETS[0]} $SOURCE'),
+ CLVar('$QT3_UIC $QT3_UICIMPLFLAGS -impl ${TARGETS[0].file} '
'-o ${TARGETS[1]} $SOURCE'),
- CLVar('$QT_MOC $QT_MOCFROMHFLAGS -o ${TARGETS[2]} ${TARGETS[0]}')],
+ CLVar('$QT3_MOC $QT3_MOCFROMHFLAGS -o ${TARGETS[2]} ${TARGETS[0]}')],
# command to generate meta object information for a class
# declarated in a header
- QT_MOCFROMHCOM = (
- '$QT_MOC $QT_MOCFROMHFLAGS -o ${TARGETS[0]} $SOURCE'),
+ QT3_MOCFROMHCOM = (
+ '$QT3_MOC $QT3_MOCFROMHFLAGS -o ${TARGETS[0]} $SOURCE'),
# command to generate meta object information for a class
# declarated in a cpp file
- QT_MOCFROMCXXCOM = [
- CLVar('$QT_MOC $QT_MOCFROMCXXFLAGS -o ${TARGETS[0]} $SOURCE'),
+ QT3_MOCFROMCXXCOM = [
+ CLVar('$QT3_MOC $QT3_MOCFROMCXXFLAGS -o ${TARGETS[0]} $SOURCE'),
Action(checkMocIncluded,None)])
# ... and the corresponding builders
- uicBld = Builder(action=SCons.Action.Action('$QT_UICCOM', '$QT_UICCOMSTR'),
+ uicBld = Builder(action=SCons.Action.Action('$QT3_UICCOM', '$QT3_UICCOMSTR'),
emitter=uicEmitter,
- src_suffix='$QT_UISUFFIX',
- suffix='$QT_UICDECLSUFFIX',
- prefix='$QT_UICDECLPREFIX',
+ src_suffix='$QT3_UISUFFIX',
+ suffix='$QT3_UICDECLSUFFIX',
+ prefix='$QT3_UICDECLPREFIX',
source_scanner=uicScanner)
mocBld = Builder(action={}, prefix={}, suffix={})
for h in header_extensions:
- act = SCons.Action.Action('$QT_MOCFROMHCOM', '$QT_MOCFROMHCOMSTR')
+ act = SCons.Action.Action('$QT3_MOCFROMHCOM', '$QT3_MOCFROMHCOMSTR')
mocBld.add_action(h, act)
- mocBld.prefix[h] = '$QT_MOCHPREFIX'
- mocBld.suffix[h] = '$QT_MOCHSUFFIX'
+ mocBld.prefix[h] = '$QT3_MOCHPREFIX'
+ mocBld.suffix[h] = '$QT3_MOCHSUFFIX'
for cxx in cxx_suffixes:
- act = SCons.Action.Action('$QT_MOCFROMCXXCOM', '$QT_MOCFROMCXXCOMSTR')
+ act = SCons.Action.Action('$QT3_MOCFROMCXXCOM', '$QT3_MOCFROMCXXCOMSTR')
mocBld.add_action(cxx, act)
- mocBld.prefix[cxx] = '$QT_MOCCXXPREFIX'
- mocBld.suffix[cxx] = '$QT_MOCCXXSUFFIX'
+ mocBld.prefix[cxx] = '$QT3_MOCCXXPREFIX'
+ mocBld.suffix[cxx] = '$QT3_MOCCXXSUFFIX'
# register the builders
env['BUILDERS']['Uic'] = uicBld
@@ -356,10 +360,10 @@ def generate(env):
SHLIBEMITTER=[AutomocShared],
LDMODULEEMITTER=[AutomocShared],
LIBEMITTER =[AutomocStatic],
- # Of course, we need to link against the qt libraries
- CPPPATH=["$QT_CPPPATH"],
- LIBPATH=["$QT_LIBPATH"],
- LIBS=['$QT_LIB'])
+ # Of course, we need to link against the qt3 libraries
+ CPPPATH=["$QT3_CPPPATH"],
+ LIBPATH=["$QT3_LIBPATH"],
+ LIBS=['$QT3_LIB'])
def exists(env):
return _detect(env)
diff --git a/SCons/Tool/qt.xml b/SCons/Tool/qt3.xml
index 5298a82c4..88df2e8f2 100644
--- a/SCons/Tool/qt.xml
+++ b/SCons/Tool/qt3.xml
@@ -23,7 +23,7 @@ See its __doc__ string for a discussion of the format.
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">
+<tool name="qt3">
<summary>
<para>
Sets &consvars; for building Qt3 applications.
@@ -60,11 +60,11 @@ you have to explicitly specify it at Environment creation:
</para>
<example_commands>
-Environment(tools=['default','qt'])
+Environment(tools=['default','qt3'])
</example_commands>
<para>
-The &t-qt; tool supports the following operations:
+The &t-qt3; tool supports the following operations:
</para>
<para>
@@ -79,7 +79,7 @@ directory. It must have one of the suffixes
<filename>.hxx</filename>,
<filename>.hh</filename>.
You can turn off automatic moc file generation by setting
-&cv-link-QT_AUTOSCAN; to <constant>False</constant>.
+&cv-link-qt3_AUTOSCAN; to <constant>False</constant>.
See also the corresponding
&b-link-Moc; Builder.
</para>
@@ -89,11 +89,11 @@ See also the corresponding
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
+<literal>${qt3_MOCCXXPREFIX}&lt;basename&gt;${QT3_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
+You can turn off automatic moc file generation by setting &cv-QT3_AUTOSCAN; to
<literal>False</literal>. See also the corresponding
&b-link-Moc; Builder.
</para>
@@ -113,33 +113,33 @@ See also the corresponding
</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>
+<item>QT3DIR</item>
+<item>QT3_BINPATH</item>
+<item>QT3_CPPPATH</item>
+<item>QT3_LIBPATH</item>
+<item>QT3_MOC</item>
+<item>QT3_UIC</item>
+<item>QT3_LIB</item>
+<item>QT3_AUTOSCAN</item>
+<item>QT3_UICIMPLFLAGS</item>
+<item>QT3_UICDECLFLAGS</item>
+<item>QT3_MOCFROMHFLAGS</item>
+<item>QT3_MOCFROMCXXFLAGS</item>
+<item>QT3_UICDECLPREFIX</item>
+<item>QT3_UICDECLSUFFIX</item>
+<item>QT3_UICIMPLPREFIX</item>
+<item>QT3_UICIMPLSUFFIX</item>
+<item>QT3_MOCHPREFIX</item>
+<item>QT3_MOCHSUFFIX</item>
+<item>QT3_MOCCXXPREFIX</item>
+<item>QT3_MOCCXXSUFFIX</item>
+<item>QT3_UISUFFIX</item>
+<item>QT3_UICCOM</item>
+<item>QT3_MOCFROMHCOM</item>
+<item>QT3_MOCFROMCXXCOM</item>
</sets>
<uses>
-<item>QTDIR</item>
+<item>QT3DIR</item>
</uses>
</tool>
@@ -149,7 +149,7 @@ See also the corresponding
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.
+tool &t-link-qt;. See the &cv-link-QT3DIR; variable for more information.
Example:
</para>
@@ -172,7 +172,7 @@ files to the &b-link-Program;,
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.
+See the &cv-link-QT3DIR; variable for more information.
Example:
</para>
@@ -186,7 +186,7 @@ env.Uic(
</summary>
</builder>
-<cvar name="QTDIR">
+<cvar name="QT3DIR">
<summary>
<para>
The path to the Qt installation to build against.
@@ -198,7 +198,7 @@ if not found there, it tries to make a guess.
</summary>
</cvar>
-<cvar name="QT_AUTOSCAN">
+<cvar name="QT3_AUTOSCAN">
<summary>
<para>
Turn off scanning for mocable files. Use the &b-link-Moc; Builder to explicitly
@@ -207,20 +207,20 @@ specify files to run <command>moc</command> on.
</summary>
</cvar>
-<cvar name="QT_BINPATH">
+<cvar name="QT3_BINPATH">
<summary>
<para>
The path where the Qt binaries are installed.
-The default value is '&cv-link-QTDIR;<filename>/bin</filename>'.
+The default value is '&cv-link-QT3DIR;<filename>/bin</filename>'.
</para>
</summary>
</cvar>
-<cvar name="QT_CPPPATH">
+<cvar name="QT3_CPPPATH">
<summary>
<para>
The path where the Qt header files are installed.
-The default value is '&cv-link-QTDIR;/include'.
+The default value is '&cv-link-QT3DIR;/include'.
Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-CPPPATH;
construction variable.
@@ -228,7 +228,7 @@ construction variable.
</summary>
</cvar>
-<cvar name="QT_DEBUG">
+<cvar name="QT3_DEBUG">
<summary>
<para>
Prints lots of debugging information while scanning for moc files.
@@ -236,7 +236,7 @@ Prints lots of debugging information while scanning for moc files.
</summary>
</cvar>
-<cvar name="QT_LIB">
+<cvar name="QT3_LIB">
<summary>
<para>
Default value is <literal>'qt'</literal>.
@@ -247,11 +247,11 @@ the tool won't change the &cv-link-LIBS; variable.
</summary>
</cvar>
-<cvar name="QT_LIBPATH">
+<cvar name="QT3_LIBPATH">
<summary>
<para>
The path where the Qt libraries are installed.
-The default value is '&cv-link-QTDIR;<filename>/lib</filename>'.
+The default value is '&cv-link-QT3DIR;<filename>/lib</filename>'.
Note: If you set this variable to <constant>None</constant>,
the tool won't change the &cv-link-LIBPATH;
construction variable.
@@ -259,15 +259,15 @@ construction variable.
</summary>
</cvar>
-<cvar name="QT_MOC">
+<cvar name="QT3_MOC">
<summary>
<para>
-Default value is '&cv-link-QT_BINPATH;<filename>/moc</filename>'.
+Default value is '&cv-link-QT3_BINPATH;<filename>/moc</filename>'.
</para>
</summary>
</cvar>
-<cvar name="QT_MOCCXXPREFIX">
+<cvar name="QT3_MOCCXXPREFIX">
<summary>
<para>
Default value is <literal>''</literal>.
@@ -276,7 +276,7 @@ Prefix for <command>moc</command> output files when source is a C++ file.
</summary>
</cvar>
-<cvar name="QT_MOCCXXSUFFIX">
+<cvar name="QT3_MOCCXXSUFFIX">
<summary>
<para>
Default value is <literal>'.moc'</literal>.
@@ -285,7 +285,7 @@ Suffix for <command>moc</command> output files when source is a C++ file.
</summary>
</cvar>
-<cvar name="QT_MOCFROMCXXFLAGS">
+<cvar name="QT3_MOCFROMCXXFLAGS">
<summary>
<para>
Default value is <literal>'-i'</literal>.
@@ -294,7 +294,7 @@ These flags are passed to <command>moc</command> when moccing a C++ file.
</summary>
</cvar>
-<cvar name="QT_MOCFROMCXXCOM">
+<cvar name="QT3_MOCFROMCXXCOM">
<summary>
<para>
Command to generate a moc file from a C++ file.
@@ -302,16 +302,16 @@ Command to generate a moc file from a C++ file.
</summary>
</cvar>
-<cvar name="QT_MOCFROMCXXCOMSTR">
+<cvar name="QT3_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.
+If this is not set, then &cv-link-QT3_MOCFROMCXXCOM; (the command line) is displayed.
</para>
</summary>
</cvar>
-<cvar name="QT_MOCFROMHCOM">
+<cvar name="QT3_MOCFROMHCOM">
<summary>
<para>
Command to generate a moc file from a header.
@@ -319,16 +319,16 @@ Command to generate a moc file from a header.
</summary>
</cvar>
-<cvar name="QT_MOCFROMHCOMSTR">
+<cvar name="QT3_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.
+If this is not set, then &cv-link-QT3_MOCFROMHCOM; (the command line) is displayed.
</para>
</summary>
</cvar>
-<cvar name="QT_MOCFROMHFLAGS">
+<cvar name="QT3_MOCFROMHFLAGS">
<summary>
<para>
Default value is <literal>''</literal>. These flags are passed to <command>moc</command>
@@ -337,7 +337,7 @@ when moccing a header file.
</summary>
</cvar>
-<cvar name="QT_MOCHPREFIX">
+<cvar name="QT3_MOCHPREFIX">
<summary>
<para>
Default value is <literal>'moc_'</literal>.
@@ -346,7 +346,7 @@ Prefix for <command>moc</command> output files when source is a header.
</summary>
</cvar>
-<cvar name="QT_MOCHSUFFIX">
+<cvar name="QT3_MOCHSUFFIX">
<summary>
<para>
Default value is '&cv-link-CXXFILESUFFIX;'.
@@ -355,15 +355,15 @@ Suffix for moc output files when source is a header.
</summary>
</cvar>
-<cvar name="QT_UIC">
+<cvar name="QT3_UIC">
<summary>
<para>
-Default value is '&cv-link-QT_BINPATH;<filename>/uic</filename>'.
+Default value is '&cv-link-QT3_BINPATH;<filename>/uic</filename>'.
</para>
</summary>
</cvar>
-<cvar name="QT_UICCOM">
+<cvar name="QT3_UICCOM">
<summary>
<para>
Command to generate header files from <filename>.ui</filename> files.
@@ -371,16 +371,16 @@ Command to generate header files from <filename>.ui</filename> files.
</summary>
</cvar>
-<cvar name="QT_UICCOMSTR">
+<cvar name="QT3_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.
+If this is not set, then &cv-link-QT3_UICCOM; (the command line) is displayed.
</para>
</summary>
</cvar>
-<cvar name="QT_UICDECLFLAGS">
+<cvar name="QT3_UICDECLFLAGS">
<summary>
<para>
Default value is ''. These flags are passed to <command>uic</command>
@@ -389,7 +389,7 @@ when creating a header file from a <filename>.ui</filename> file.
</summary>
</cvar>
-<cvar name="QT_UICDECLPREFIX">
+<cvar name="QT3_UICDECLPREFIX">
<summary>
<para>
Default value is <literal>''</literal>.
@@ -398,7 +398,7 @@ Prefix for <command>uic</command> generated header files.
</summary>
</cvar>
-<cvar name="QT_UICDECLSUFFIX">
+<cvar name="QT3_UICDECLSUFFIX">
<summary>
<para>
Default value is <literal>'.h'</literal>.
@@ -407,7 +407,7 @@ Suffix for <command>uic</command> generated header files.
</summary>
</cvar>
-<cvar name="QT_UICIMPLFLAGS">
+<cvar name="QT3_UICIMPLFLAGS">
<summary>
<para>
Default value is <literal>''</literal>.
@@ -417,7 +417,7 @@ file from a <filename>.ui</filename> file.
</summary>
</cvar>
-<cvar name="QT_UICIMPLPREFIX">
+<cvar name="QT3_UICIMPLPREFIX">
<summary>
<para>
Default value is <literal>'uic_'</literal>.
@@ -426,7 +426,7 @@ Prefix for uic generated implementation files.
</summary>
</cvar>
-<cvar name="QT_UICIMPLSUFFIX">
+<cvar name="QT3_UICIMPLSUFFIX">
<summary>
<para>
Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for uic generated implementation
@@ -435,7 +435,7 @@ files.
</summary>
</cvar>
-<cvar name="QT_UISUFFIX">
+<cvar name="QT3_UISUFFIX">
<summary>
<para>
Default value is <literal>'.ui'</literal>.
diff --git a/test/QT/CPPPATH-appended.py b/test/QT/qt3/CPPPATH-appended.py
index ee1808faf..ee1808faf 100644
--- a/test/QT/CPPPATH-appended.py
+++ b/test/QT/qt3/CPPPATH-appended.py
diff --git a/test/QT/CPPPATH.py b/test/QT/qt3/CPPPATH.py
index b56efad44..b56efad44 100644
--- a/test/QT/CPPPATH.py
+++ b/test/QT/qt3/CPPPATH.py
diff --git a/test/QT/QTFLAGS.py b/test/QT/qt3/QTFLAGS.py
index c759c2a4a..c759c2a4a 100644
--- a/test/QT/QTFLAGS.py
+++ b/test/QT/qt3/QTFLAGS.py
diff --git a/test/QT/Tool.py b/test/QT/qt3/Tool.py
index 122e7f413..122e7f413 100644
--- a/test/QT/Tool.py
+++ b/test/QT/qt3/Tool.py
diff --git a/test/QT/copied-env.py b/test/QT/qt3/copied-env.py
index 74f59b7fc..3b2a83ed7 100644
--- a/test/QT/copied-env.py
+++ b/test/QT/qt3/copied-env.py
@@ -33,7 +33,7 @@ test = TestSCons.TestSCons()
test.Qt_dummy_installation()
-test.Qt_create_SConstruct('SConstruct')
+test.Qt_create_SConstruct('SConstruct', qt_tool='qt3')
test.write('SConscript', """\
Import("env")
diff --git a/test/QT/empty-env.py b/test/QT/qt3/empty-env.py
index e9dfc81b1..e9dfc81b1 100644
--- a/test/QT/empty-env.py
+++ b/test/QT/qt3/empty-env.py
diff --git a/test/QT/generated-ui.py b/test/QT/qt3/generated-ui.py
index fd368b34d..fd368b34d 100644
--- a/test/QT/generated-ui.py
+++ b/test/QT/qt3/generated-ui.py
diff --git a/test/QT/installed.py b/test/QT/qt3/installed.py
index 9e8693e3f..9e8693e3f 100644
--- a/test/QT/installed.py
+++ b/test/QT/qt3/installed.py
diff --git a/test/QT/manual.py b/test/QT/qt3/manual.py
index 84c6df8e0..84c6df8e0 100644
--- a/test/QT/manual.py
+++ b/test/QT/qt3/manual.py
diff --git a/test/QT/moc-from-cpp.py b/test/QT/qt3/moc-from-cpp.py
index bbab8cab8..bbab8cab8 100644
--- a/test/QT/moc-from-cpp.py
+++ b/test/QT/qt3/moc-from-cpp.py
diff --git a/test/QT/moc-from-header.py b/test/QT/qt3/moc-from-header.py
index 65a12e1ed..65a12e1ed 100644
--- a/test/QT/moc-from-header.py
+++ b/test/QT/qt3/moc-from-header.py
diff --git a/test/QT/qt_warnings.py b/test/QT/qt3/qt_warnings.py
index fb23a7151..fb23a7151 100644
--- a/test/QT/qt_warnings.py
+++ b/test/QT/qt3/qt_warnings.py
diff --git a/test/QT/reentrant.py b/test/QT/qt3/reentrant.py
index 40fb1f19a..40fb1f19a 100644
--- a/test/QT/reentrant.py
+++ b/test/QT/qt3/reentrant.py
diff --git a/test/QT/source-from-ui.py b/test/QT/qt3/source-from-ui.py
index 569fbab2c..569fbab2c 100644
--- a/test/QT/source-from-ui.py
+++ b/test/QT/qt3/source-from-ui.py
diff --git a/test/QT/up-to-date.py b/test/QT/qt3/up-to-date.py
index 06fb5590e..06fb5590e 100644
--- a/test/QT/up-to-date.py
+++ b/test/QT/qt3/up-to-date.py
diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py
index 469f6c1c5..b6c9f094b 100644
--- a/testing/framework/TestSCons.py
+++ b/testing/framework/TestSCons.py
@@ -1172,17 +1172,17 @@ else:
self.QT_UIC = f"{_python_} {self.workpath(dir, 'bin', 'myuic.py')}"
self.QT_LIB_DIR = self.workpath(dir, 'lib')
- def Qt_create_SConstruct(self, place):
+ def Qt_create_SConstruct(self, place, qt_tool='qt3'):
if isinstance(place, list):
place = test.workpath(*place)
- self.write(place, """\
+ self.write(place, f"""\
if ARGUMENTS.get('noqtdir', 0):
QTDIR = None
else:
- QTDIR = r'%s'
+ QTDIR = r'{self.QT}'
DefaultEnvironment(tools=[]) # test speedup
env = Environment(
- QTDIR=QTDIR, QT_LIB=r'%s', QT_MOC=r'%s', QT_UIC=r'%s', tools=['default', 'qt']
+ QTDIR=QTDIR, QT_LIB=r'{self.QT_LIB}', QT_MOC=r'{self.QT_MOC}', QT_UIC=r'{self.QT_UIC}', tools=['default', '{qt_tool}']
)
dup = 1
if ARGUMENTS.get('variant_dir', 0):
@@ -1203,7 +1203,7 @@ else:
sconscript = File('SConscript')
Export("env dup")
SConscript(sconscript)
-""" % (self.QT, self.QT_LIB, self.QT_MOC, self.QT_UIC))
+""")
NCR = 0 # non-cached rebuild
CR = 1 # cached rebuild (up to date)