SConstruct, fix compiling on systems where qt4 is not installed
This commit is contained in:
parent
fce0cb80a2
commit
50b5278315
|
@ -42,6 +42,9 @@ testrunner = testEnv.Program('testrunner', testFiles)
|
||||||
Alias('testrunner',[testrunner])
|
Alias('testrunner',[testrunner])
|
||||||
|
|
||||||
# GUI
|
# GUI
|
||||||
|
emptyEnv = Environment()
|
||||||
|
conf = Configure(emptyEnv)
|
||||||
|
try:
|
||||||
QTDIR = os.popen('qmake -query QT_INSTALL_DATA').read()
|
QTDIR = os.popen('qmake -query QT_INSTALL_DATA').read()
|
||||||
pkgpath = os.environ.get("PKG_CONFIG_PATH", "")
|
pkgpath = os.environ.get("PKG_CONFIG_PATH", "")
|
||||||
pkgpath += ":%s/lib/pkgconfig" % QTDIR
|
pkgpath += ":%s/lib/pkgconfig" % QTDIR
|
||||||
|
@ -56,6 +59,10 @@ uis = [guiEnv.Uic4(ui) for ui in uiFiles]
|
||||||
guiFiles = Glob('gui/*.cpp')+libObjects
|
guiFiles = Glob('gui/*.cpp')+libObjects
|
||||||
gui = guiEnv.Program(target="gui_cppcheck", source=[rccs, guiFiles])
|
gui = guiEnv.Program(target="gui_cppcheck", source=[rccs, guiFiles])
|
||||||
Alias('gui',[gui])
|
Alias('gui',[gui])
|
||||||
|
except:
|
||||||
|
gui = Alias('gui','')
|
||||||
|
if 'gui' in COMMAND_LINE_TARGETS:
|
||||||
|
print "Qt4 not found. It is required for gui"
|
||||||
|
|
||||||
# Execute testrunner
|
# Execute testrunner
|
||||||
test = AlwaysBuild(Alias("test", testrunner, "./$SOURCE"))
|
test = AlwaysBuild(Alias("test", testrunner, "./$SOURCE"))
|
||||||
|
|
Loading…
Reference in New Issue