summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-09-23 22:42:15 (GMT)
committerGitHub <noreply@github.com>2018-09-23 22:42:15 (GMT)
commit011eaa1d4944572faf60c6cc9bd56844fc1f2ed2 (patch)
treea00aac4391b7dad172158c0b6f6dda3623c44f05
parent171e7f6e01d3ae9927fc2ccdbe6dcc2363d56bec (diff)
parent5f09733499c7d1c8cb559a02ea1e6e4fef3825ea (diff)
downloadSCons-011eaa1d4944572faf60c6cc9bd56844fc1f2ed2.zip
SCons-011eaa1d4944572faf60c6cc9bd56844fc1f2ed2.tar.gz
SCons-011eaa1d4944572faf60c6cc9bd56844fc1f2ed2.tar.bz2
Merge pull request #3198 from bdbaddog/fix_qt_tests_centos
Fix path to qt install for centos. It's not in the default posix PATH set by scons.
-rw-r--r--src/CHANGES.txt1
-rw-r--r--src/engine/SCons/Tool/qt.py39
2 files changed, 32 insertions, 8 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 4f36ae4..12df163 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -46,6 +46,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
- Fix GH Issue #3141 unicode string in a TryAction() with python 2.7 crashes.
- Fixed issue causing stack trace when python Action function contains a unicode string when being
run with Python 2.7
+ - Add alternate path to QT install for Centos in qt tool: /usr/lib64/qt-3.3/bin
From Andrew Featherstone
- Removed unused --warn options from the man page and source code.
diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py
index 77269a8..b8cf77a 100644
--- a/src/engine/SCons/Tool/qt.py
+++ b/src/engine/SCons/Tool/qt.py
@@ -37,6 +37,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import re
+import glob
import SCons.Action
import SCons.Builder
@@ -44,6 +45,8 @@ import SCons.Defaults
import SCons.Scanner
import SCons.Tool
import SCons.Util
+import SCons.Tool.cxx
+cplusplus = SCons.Tool.cxx
class ToolQtWarning(SCons.Warnings.Warning):
pass
@@ -60,12 +63,33 @@ header_extensions = [".h", ".hxx", ".hpp", ".hh"]
if SCons.Util.case_sensitive_suffixes('.h', '.H'):
header_extensions.append('.H')
-import SCons.Tool.cxx
-cplusplus = SCons.Tool.cxx
-#cplusplus = __import__('cxx', globals(), locals(), [])
-
cxx_suffixes = cplusplus.CXXSuffixes
+
+#
+def find_platform_specific_qt_paths():
+ """
+ If the platform has non-standard paths which it installs QT in,return the likely default path
+ :return:
+ """
+
+ # qt_bin_dirs = []
+ qt_bin_dir = None
+ if os.path.isfile('/etc/redhat-release'):
+ with open('/etc/redhat-release','r') as rr:
+ lines = rr.readlines()
+ distro = lines[0].split()[0]
+ 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')
+ qt_bin_dir = '/usr/lib64/qt-3.3/bin'
+
+ return qt_bin_dir
+
+
+QT_BIN_DIR = find_platform_specific_qt_paths()
+
def checkMocIncluded(target, source, env):
moc = target[0]
cpp = source[0]
@@ -188,13 +212,12 @@ AutomocStatic = _Automoc('StaticObject')
def _detect(env):
"""Not really safe, but fast method to detect the QT library"""
- QTDIR = None
- if not QTDIR:
- QTDIR = env.get('QTDIR',None)
+
+ QTDIR = env.get('QTDIR',None)
if not QTDIR:
QTDIR = os.environ.get('QTDIR',None)
if not QTDIR:
- moc = env.WhereIs('moc')
+ moc = env.WhereIs('moc') or env.WhereIs('moc',QT_BIN_DIR)
if moc:
QTDIR = os.path.dirname(os.path.dirname(moc))
SCons.Warnings.warn(