# 
#   Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# 

#
# Build the Qt gui
# 
if BUILD_QT4_GUI

Qt4Gui.moc: $(srcdir)/qt/Qt4Gui.h
	@if test x"$(MOC4)" != x; then \
	  echo "Generating MOC file: Qt4Gui.moc."; \
	  $(MOC4) $(srcdir)/qt/Qt4Gui.h -o Qt4Gui.moc; \
	else  \
	  echo "WARNING: Install QT 4.x moc tool! Using default MOC file"; \
	  ln -sf $(srcdir)/qt/Qt4Gui.moc.in Qt4Gui.moc; \
	fi

Qt4Glue.moc: $(srcdir)/qt/Qt4Glue.h
	@if test x"$(MOC4)" != x; then \
	  echo "Generating MOC file: Qt4Glue.moc."; \
	  $(MOC4) $(srcdir)/qt/Qt4Glue.h -o Qt4Glue.moc; \
	else  \
	  echo "WARNING: Install QT 4.x moc tool! Using default MOC file"; \
	  ln -sf $(srcdir)/qt/Qt4Glue.moc.in Qt4Glue.moc; \
	fi

endif

bin_PROGRAMS += qt4-gnash

qt4_gnash_SOURCES = $(GUI_SRCS) \
	qt/GuiQt4.cpp \
	qt/Qt4Gui.cpp \
	qt/Qt4Glue.cpp \
	qt/Qt4Gui.h \
	qt/Qt4Glue.h

qt4_gnash_CPPFLAGS = -DGUI_QT4 -DGUI_CONFIG=\"QT4\" $(AM_CPPFLAGS) $(QT4_CFLAGS)
qt4_gnash_LDFLAGS = -export-dynamic 
qt4_gnash_LDADD = \
	$(GNASH_LIBS) \
	$(AM_LDFLAGS) \
    $(BOOST_LIBS) \
	$(X11_LIBS) \
	$(NULL)

if BUILD_OGL_RENDERER
qt4_gnash_CPPFLAGS += $(OPENGL_CFLAGS)
qt4_gnash_LDADD += $(top_builddir)/librender/libgnashrender.la \
	$(QT4_LIBS) $(OGL_LIBS) -lQtOpenGL
qt4_gnash_SOURCES += qt/Qt4GlueOgl.cpp qt/Qt4GlueOgl.h
endif                           # BUILD_OGL_RENDERER

if BUILD_CAIRO_RENDERER
qt4_gnash_CPPFLAGS += $(CAIRO_CFLAGS) $(X11_CFLAGS)
qt4_gnash_LDADD += $(top_builddir)/librender/libgnashrender.la \
	$(QT4_LIBS) $(CAIRO_LIBS)
qt4_gnash_SOURCES += qt/Qt4GlueCairo.cpp qt/Qt4GlueCairo.h
endif                           # BUILD_CAIRO_RENDERER

if BUILD_AGG_RENDERER
qt4_gnash_CPPFLAGS += $(AGG_CFLAGS) $(X11_CFLAGS)
qt4_gnash_LDADD += $(top_builddir)/librender/libgnashrender.la \
	$(QT4_LIBS) $(AGG_LIBS)
qt4_gnash_SOURCES += qt/Qt4GlueAgg.cpp qt/Qt4GlueAgg.h
endif

