diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-06-15 22:06:31 (GMT) |
|---|---|---|
| committer | Kevin Smith <kevin.smith@isode.com> | 2015-06-18 09:48:39 (GMT) |
| commit | c565fb97c2925b66f81e05ffb6a394d3d53173a0 (patch) | |
| tree | 87348cf4e53360465920bc0d07419e3a46bb5c63 | |
| parent | 823d751ca2ca5c7b36ce674f20c57f7a5196d992 (diff) | |
| download | swift-c565fb97c2925b66f81e05ffb6a394d3d53173a0.zip swift-c565fb97c2925b66f81e05ffb6a394d3d53173a0.tar.bz2 | |
Have SCons qt4 tool check for real moc or qtchooser
Some platforms, e.g. KUbuntu, provide a wrapper around Qt's commands
that allow easy switching between different Qt versions. With this
change SCons will execute the found moc tool and check whether it works
or not.
Test-Information:
Tested with correctly installed Qt and uninstalled Qt on KUbuntu 14.04.
Change-Id: I88f0a36af462e909829c30115aa5481abdcd3ac6
| -rw-r--r-- | BuildTools/SCons/Tools/qt4.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py index afa61de..625f807 100644 --- a/BuildTools/SCons/Tools/qt4.py +++ b/BuildTools/SCons/Tools/qt4.py | |||
| @@ -36,6 +36,7 @@ __revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/T | |||
| 36 | 36 | ||
| 37 | import os.path | 37 | import os.path |
| 38 | import re | 38 | import re |
| 39 | import subprocess | ||
| 39 | 40 | ||
| 40 | import SCons.Action | 41 | import SCons.Action |
| 41 | import SCons.Builder | 42 | import SCons.Builder |
| @@ -207,14 +208,18 @@ def _detect(env): | |||
| 207 | else : | 208 | else : |
| 208 | moc = env.WhereIs('moc-qt4') or env.WhereIs('moc4') or env.WhereIs('moc') | 209 | moc = env.WhereIs('moc-qt4') or env.WhereIs('moc4') or env.WhereIs('moc') |
| 209 | if moc: | 210 | if moc: |
| 210 | import sys | 211 | # Test whether the moc command we found is real, or whether it is just the qtchooser dummy. |
| 211 | if sys.platform == "darwin" : | 212 | p = subprocess.Popen([moc, "-v"], shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) |
| 212 | return "" | 213 | p.communicate() |
| 213 | QTDIR = os.path.dirname(os.path.dirname(moc)) | 214 | if p.returncode == 0: |
| 214 | SCons.Warnings.warn( | 215 | import sys |
| 215 | QtdirNotFound, | 216 | if sys.platform == "darwin" : |
| 216 | "QTDIR variable is not defined, using moc executable as a hint (QTDIR=%s)" % QTDIR) | 217 | return "" |
| 217 | return QTDIR | 218 | QTDIR = os.path.dirname(os.path.dirname(moc)) |
| 219 | SCons.Warnings.warn( | ||
| 220 | QtdirNotFound, | ||
| 221 | "QTDIR variable is not defined, using moc executable as a hint (QTDIR=%s)" % QTDIR) | ||
| 222 | return QTDIR | ||
| 218 | 223 | ||
| 219 | raise SCons.Errors.StopError( | 224 | raise SCons.Errors.StopError( |
| 220 | QtdirNotFound, | 225 | QtdirNotFound, |
Swift