SConstruct, fix compiling on systems where qt4 is not installed

This commit is contained in:
Reijo Tomperi 2010-02-19 22:47:37 +02:00
parent fce0cb80a2
commit 50b5278315
1 changed files with 21 additions and 14 deletions

View File

@ -42,6 +42,9 @@ testrunner = testEnv.Program('testrunner', testFiles)
Alias('testrunner',[testrunner])
# GUI
emptyEnv = Environment()
conf = Configure(emptyEnv)
try:
QTDIR = os.popen('qmake -query QT_INSTALL_DATA').read()
pkgpath = os.environ.get("PKG_CONFIG_PATH", "")
pkgpath += ":%s/lib/pkgconfig" % QTDIR
@ -56,6 +59,10 @@ uis = [guiEnv.Uic4(ui) for ui in uiFiles]
guiFiles = Glob('gui/*.cpp')+libObjects
gui = guiEnv.Program(target="gui_cppcheck", source=[rccs, guiFiles])
Alias('gui',[gui])
except:
gui = Alias('gui','')
if 'gui' in COMMAND_LINE_TARGETS:
print "Qt4 not found. It is required for gui"
# Execute testrunner
test = AlwaysBuild(Alias("test", testrunner, "./$SOURCE"))