#!/usr/bin/env python
import autowaf

def build(bld):
	obj = bld.new_task_gen('cxx', 'shlib')
	obj.source = '''
		App.cpp
		BreadCrumbs.cpp
		Configuration.cpp
		ConnectWindow.cpp
		Connection.cpp
		ControlPanel.cpp
		Controls.cpp
		GladeFactory.cpp
		LoadPatchWindow.cpp
		LoadPluginWindow.cpp
		LoadRemotePatchWindow.cpp
		LoadSubpatchWindow.cpp
		MessagesWindow.cpp
		NewSubpatchWindow.cpp
		NodeControlWindow.cpp
		NodeMenu.cpp
		NodeModule.cpp
		NodePropertiesWindow.cpp
		ObjectMenu.cpp
		PatchCanvas.cpp
		PatchPortModule.cpp
		PatchPropertiesWindow.cpp
		PatchTreeWindow.cpp
		PatchView.cpp
		PatchWindow.cpp
		Port.cpp
		PortMenu.cpp
		PortPropertiesWindow.cpp
		RenameWindow.cpp
		SubpatchModule.cpp
		ThreadedLoader.cpp
		Window.cpp
		WindowFactory.cpp
		gui.cpp
	'''

	if bld.env['HAVE_CURL'] != 0:
		obj.source += 'UploadPatchWindow.cpp'

	obj.export_incdirs = ['.']
	obj.includes       = ['.', '..', '../..', '../common', '../client', '../module']
	obj.name           = 'libingen_gui'
	obj.target         = 'ingen_gui'
	obj.install_path   = '${LIBDIR}/ingen'
	obj.uselib_local   = 'libingen_shared libingen_module'
	autowaf.use_lib(bld, obj, '''
		CURL
		FLOWCANVAS
		GLADEMM
		GLIBMM
		GNOMECANVASMM
		GTKMM
		RAUL
		REDLANDMM
		SIGCPP
		LV2CORE
		SLV2
		SOUP
		XML2
	''')

	# GUI runtime files
	bld.install_files('${DATADIR}/ingen', 'ingen_gui.glade')