Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision 68c92366449b96cba16e719bf1bc16ca92f66370)
+++ src/UIElements/Makefile.am	(revision db1a72013fea41fc1ac6c55b5d884661f6460d22)
@@ -250,12 +250,9 @@
   UIElements/Qt4/Pipe/QtQueryListPipe.hpp
 
-lib_LTLIBRARIES += libMolecuilderUI.la \
-  libMolecuilderQtUI.la
+lib_LTLIBRARIES += libMolecuilderUI.la
 libMolecuilderUI_la_includedir = $(includedir)/MoleCuilder/UIElements/
-libMolecuilderQtUI_la_includedir = $(includedir)/MoleCuilder/UIElements/
 libMolecuilderUI_la_CPPFLAGS = ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS}
-libMolecuilderQtUI_la_CPPFLAGS = ${QT_CFLAGS} ${GLU_CXXFLAGS} ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS}
 libMolecuilderUI_la_LDFLAGS = $(AM_LDFLAGS) $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_RANDOM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS)
-libMolecuilderQtUI_la_LDFLAGS = $(AM_LDFLAGS) $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_RANDOM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS)
+
 # NOTE: ActionPrototypes BEFORE Actions!
 # this is to ensure that static Action prototypes are instantiated after
@@ -280,12 +277,5 @@
 	$(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS)
 
-libMolecuilderQtUI_la_LIBADD = \
-	${QT_LIBS} \
-	-lQtOpenGL \
-	${GLU_LIBS}
-
-
 nobase_libMolecuilderUI_la_include_HEADERS = ${UIHEADER}
-nobase_libMolecuilderQtUI_la_include_HEADERS = ${QTUIHEADER} $(QTUIUI_UIFILES)
 
 ## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
@@ -298,6 +288,4 @@
 ## which are already listed elsewhere in a _HEADERS variable assignment.
 libMolecuilderUI_la_SOURCES = ${UISOURCE}
-libMolecuilderQtUI_la_SOURCES = ${QTUISOURCE}
-nodist_libMolecuilderQtUI_la_SOURCES =
 
 ## Instruct libtool to include ABI version information in the generated shared
@@ -305,5 +293,4 @@
 ## that all version information is kept in one place.
 libMolecuilderUI_la_LDFLAGS += -version-info $(MOLECUILDER_SO_VERSION)
-libMolecuilderQtUI_la_LDFLAGS += -version-info $(MOLECUILDER_SO_VERSION)
 
 ## The generated configuration header is installed in its own subdirectory of
@@ -319,7 +306,5 @@
 ## shipped with the source tarball.
 #libMolecuilderUI_libincludedir = $(libdir)/MoleCuilder/include
-#libMolecuilderQtUI_libincludedir = $(libdir)/MoleCuilder/include
 #nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
-#nodist_libMolecuilderQtUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
 
 ## Install the generated pkg-config file (.pc) into the expected location for
@@ -330,18 +315,31 @@
 #pkgconfig_DATA = $(top_builddir)/MoleCuilder.pc
 
-# This is the old stuff from branch molecuilderGUI which does not work
-#%.h: %.ui
-#	$(UIC) -o $@ $<
-#	
-#%.cpp: %.ui
-#	$(UIC) -o $@ -impl $*.h $<
+if CONDQTGUI
+lib_LTLIBRARIES += libMolecuilderQtUI.la
+
+libMolecuilderQtUI_la_includedir = $(includedir)/MoleCuilder/UIElements/
+libMolecuilderQtUI_la_CPPFLAGS = ${QT_CFLAGS} ${GLU_CXXFLAGS} ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS}
+libMolecuilderQtUI_la_LDFLAGS = $(AM_LDFLAGS) $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_RANDOM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS)
+
+libMolecuilderQtUI_la_LIBADD = \
+	${QT_LIBS} \
+	-lQtOpenGL \
+	${GLU_LIBS}
+
+nobase_libMolecuilderQtUI_la_include_HEADERS = ${QTUIHEADER} $(QTUIUI_UIFILES)
+libMolecuilderQtUI_la_SOURCES = ${QTUISOURCE}
+nodist_libMolecuilderQtUI_la_SOURCES =
+libMolecuilderQtUI_la_LDFLAGS += -version-info $(MOLECUILDER_SO_VERSION)
+#libMolecuilderQtUI_libincludedir = $(libdir)/MoleCuilder/include
+#nodist_libMolecuilderQtUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
 
 BUILT_SOURCES += ui_dialoglight.h ui_changeposition.h
 
-#noinst_HEADERS = dialoglight.h changeposition.h
-
 nodist_libMolecuilderQtUI_la_SOURCES += moc_dialoglight.cpp moc_changeposition.cpp
 
-#libMolecuilderQtUI_la_SOURCES += dialoglight.cpp changeposition.cpp
+MOSTLYCLEANFILES += \
+	*.moc.cpp \
+	moc_*.cpp \
+	ui_*.h
 
 ui_dialoglight.h: UIElements/Views/Qt4/dialoglight.ui
@@ -373,7 +371,3 @@
 	done;
 
-MOSTLYCLEANFILES += \
-	*.moc.cpp \
-	moc_*.cpp \
-	ui_*.h
-
+endif
