glib_dep = dependency('glib-2.0')
gobject_dep = dependency('gobject-2.0')
gtk_dep = dependency('gtk+-3.0', version: '>=3.0.0')
# gmodule-export-2.0 is needed to connect the handlers
gmodule_dep = dependency('gmodule-2.0', version: '>=2.0')
pq_dep = dependency('libpq', version: '>=9.0')

config_data = configuration_data()
config_data.set('VERSION', meson.project_version())
config_data.set('GETTEXT_PACKAGE', meson.project_name())

config_data_file = configure_file(input: 'config.vala.in',
	output: 'config.vala',
	configuration: config_data)

vala_sources = files(
	'asignatura_list.vala',
	'colegio.vala',
	'db.vala',
	'dbwrapper.vala',
	'misc.vala',
	'main_window.vala',
	'queries.vala',
	'query_window.vala',
	'db/asignatura.vala',
	'db/ciudad.vala',
	'db/profesor.vala',
	'db/q1.vala',
	'db/q2.vala',
	'db/q3.vala',
	'db/q4.vala',
	'db/q5.vala',
	'db/q6.vala',
	'db/region.vala')

sources = vala_sources
sources += main_gresource
sources += asignatura_gresource
sources += query_gresource
sources += config_data_file

vala_args = ['--vapidir=' + join_paths(meson.source_root(), 'vapi')]

inc = include_directories('./')

exe = executable(meson.project_name(),
	sources,
	vala_args: vala_args,
	include_directories : inc,
	gui_app: true,
	dependencies: [glib_dep, gobject_dep, gtk_dep, gmodule_dep, pq_dep],
	install: true)
