From: stevenknight Date: Tue, 21 Oct 2003 04:24:52 +0000 (+0000) Subject: Fix a bug in Qt detection. (Christoph Wiedemann) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a91c027a45c563a529b1fe0d1d84dafd55b52992;p=scons.git Fix a bug in Qt detection. (Christoph Wiedemann) git-svn-id: http://scons.tigris.org/svn/scons/trunk@824 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index f83f3541..22edc262 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -166,6 +166,8 @@ RELEASE X.XX - XXX - Fix test/SWIG.py to find the Python include directory in all cases. + - Fix a bug in detection of Qt installed on the local system. + RELEASE 0.92 - Wed, 20 Aug 2003 03:45:28 -0500 diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py index d9f690a0..12bf1615 100644 --- a/src/engine/SCons/Tool/qt.py +++ b/src/engine/SCons/Tool/qt.py @@ -133,7 +133,7 @@ def _detect(env): if not QTDIR: moc = env.Detect('moc') if moc: - QTDIR = dirname(dirname(moc)) + QTDIR = os.path.dirname(os.path.dirname(moc)) else: QTDIR = None env['QTDIR'] = QTDIR diff --git a/test/QT.py b/test/QT.py index 0ee8a30f..ce6bff0c 100644 --- a/test/QT.py +++ b/test/QT.py @@ -291,9 +291,39 @@ test.fail_test(not os.path.exists(test.workpath('work3', 'build', moc))) if os.environ.get('QTDIR', None): + QTDIR=os.environ['QTDIR'] + + test.write( ['work4', 'SConstruct'],""" import os -env = Environment(tools=['default','qt'], CXXFILESUFFIX=".cpp") +dummy_env = Environment() +ENV = dummy_env['ENV'] +try: + PATH=ARGUMENTS['PATH'] + if ENV.has_key('PATH'): + ENV_PATH = PATH + ':' + ENV['PATH'] + else: + Exit(0) # this is certainly a weird system :-) +except KeyError: + if ENV.has_key('PATH'): + ENV_PATH=dummy_env['ENV']['PATH'] + else: + ENV_PATH='' + pass + +env = Environment(tools=['default','qt'], + ENV={'PATH':ENV_PATH, + 'HOME':os.getcwd()}, + # moc / uic want to write stuff in ~/.qt + CXXFILESUFFIX=".cpp") + +conf = env.Configure() +if not conf.CheckLib(env.subst("$QT_LIB")): + conf.env['QT_LIB'] = 'qt-mt' + if not conf.CheckLib(env.subst("$QT_LIB")): + Exit(0) +env = conf.Finish() + env.Program('test_realqt', ['mocFromCpp.cpp', 'mocFromH.cpp', 'anUiFile.ui', @@ -370,6 +400,13 @@ int main() { """) test.run(chdir='work4', arguments="test_realqt" + _exe) + + QTDIR=os.environ['QTDIR'] + del os.environ['QTDIR'] + + test.run(chdir='work4', arguments="-c test_realqt" + _exe) + test.run(chdir='work4', arguments="PATH=%s/bin test_realqt%s"%(QTDIR,_exe)) + else: print "Could not find QT, skipping test(s)."