#!/usr/bin/env python
import autowaf

def build(bld):
	# Headers
	bld.install_files('${INCLUDEDIR}/ingen/client', '*.hpp')

	obj = bld.new_task_gen('cxx', 'shlib')
	obj.source = '''
		ClientStore.cpp
		NodeModel.cpp
		ObjectModel.cpp
		PatchModel.cpp
		PluginModel.cpp
		PluginUI.cpp
		PortModel.cpp
		ThreadedSigClientInterface.cpp
		ingen_client.cpp
	'''

	if bld.env['HAVE_SOUP'] == 1:
		obj.source += '''
			HTTPClientReceiver.cpp
			HTTPEngineSender.cpp
		'''

	if bld.env['HAVE_XML2'] == 1:
		obj.source += ' DeprecatedLoader.cpp '

	if bld.env['HAVE_LIBLO'] == 1:
		obj.source += ' OSCClientReceiver.cpp OSCEngineSender.cpp '

	obj.includes     = ['.', '..', '../..', '../common']
	obj.export_incdirs = ['.']
	obj.name         = 'libingen_client'
	obj.target       = 'ingen_client'
	obj.install_path = '${LIBDIR}/ingen'
	obj.uselib_local = 'libingen_shared'
	autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE SLV2 RAUL REDLANDMM SOUP XML2 SIGCPP LIBLO SOUP')