SConstruct, fix compiling on systems where qt4 is not installed
This commit is contained in:
parent
fce0cb80a2
commit
50b5278315
35
SConstruct
35
SConstruct
|
@ -42,20 +42,27 @@ testrunner = testEnv.Program('testrunner', testFiles)
|
|||
Alias('testrunner',[testrunner])
|
||||
|
||||
# GUI
|
||||
QTDIR = os.popen('qmake -query QT_INSTALL_DATA').read()
|
||||
pkgpath = os.environ.get("PKG_CONFIG_PATH", "")
|
||||
pkgpath += ":%s/lib/pkgconfig" % QTDIR
|
||||
os.environ["PKG_CONFIG_PATH"] = pkgpath
|
||||
os.environ["QTDIR"] = QTDIR
|
||||
guiEnv = libEnv.Clone(tools=["default", "qt4"], toolpath=['.'])
|
||||
guiEnv.Append(CPPPATH = ['gui'])
|
||||
guiEnv.EnableQt4Modules(["QtGui", "QtCore"])
|
||||
rccs = [guiEnv.Qrc("gui/gui.qrc", QT4_QRCFLAGS="-name CppcheckGUI")]
|
||||
uiFiles = Glob('gui/*.ui')
|
||||
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])
|
||||
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
|
||||
os.environ["PKG_CONFIG_PATH"] = pkgpath
|
||||
os.environ["QTDIR"] = QTDIR
|
||||
guiEnv = libEnv.Clone(tools=["default", "qt4"], toolpath=['.'])
|
||||
guiEnv.Append(CPPPATH = ['gui'])
|
||||
guiEnv.EnableQt4Modules(["QtGui", "QtCore"])
|
||||
rccs = [guiEnv.Qrc("gui/gui.qrc", QT4_QRCFLAGS="-name CppcheckGUI")]
|
||||
uiFiles = Glob('gui/*.ui')
|
||||
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"))
|
||||
|
|
Loading…
Reference in New Issue