diff options
Diffstat (limited to 'engine/SCons/Tool/qt.py')
| -rw-r--r-- | engine/SCons/Tool/qt.py | 43 | 
1 files changed, 33 insertions, 10 deletions
diff --git a/engine/SCons/Tool/qt.py b/engine/SCons/Tool/qt.py index 6c39b3b..1b1925c 100644 --- a/engine/SCons/Tool/qt.py +++ b/engine/SCons/Tool/qt.py @@ -10,7 +10,7 @@ selection method.  """  # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation  #  # Permission is hereby granted, free of charge, to any person obtaining  # a copy of this software and associated documentation files (the @@ -33,10 +33,11 @@ selection method.  #  from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/qt.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/qt.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan"  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(  | 
