diff options
author | William Deegan <bill@baddogconsulting.com> | 2018-09-23 20:03:29 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-09-23 20:03:29 (GMT) |
commit | 92830df278cc22505fb1e7984e422dda35ce3503 (patch) | |
tree | 94d3c759d0dcfcc924c2ca3e71e457d7a40c147e | |
parent | 8dbecac1bd347c2d1a67b9655425c572e1b916f6 (diff) | |
download | SCons-92830df278cc22505fb1e7984e422dda35ce3503.zip SCons-92830df278cc22505fb1e7984e422dda35ce3503.tar.gz SCons-92830df278cc22505fb1e7984e422dda35ce3503.tar.bz2 |
Add centos specific likely qt path to moc as it's not in the default PATH defined by SCons
-rw-r--r-- | src/engine/SCons/Tool/qt.py | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py index 77269a8..535f3d7 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,13 @@ 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') + try_paths = os.pathsep.join([env['ENV']['PATH'],QT_BIN_DIR]) + moc = env.WhereIs('moc',try_paths) if moc: QTDIR = os.path.dirname(os.path.dirname(moc)) SCons.Warnings.warn( |