From 69a0f5761c15b13423fa062a9243f64a72c13251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Canek=20Pel=C3=A1ez=20Vald=C3=A9s?= Date: Fri, 12 May 2017 12:37:05 -0500 Subject: [PATCH] Meson: Clean up and add Valadoc support. --- meson.build | 54 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index d095ad1..27a257e 100644 --- a/meson.build +++ b/meson.build @@ -1,13 +1,17 @@ project('gqpe', ['vala', 'c'], version : '0.1') +cc = meson.get_compiler('c') + add_global_arguments('-DGETTEXT_PACKAGE="gqpe"', language: 'c') -add_project_arguments(['--vapidir', - join_paths(meson.current_source_dir(), 'vapi'), +vapidir = join_paths(meson.current_source_dir(), 'vapi') + +add_project_arguments(['--vapidir=' + vapidir, '--pkg=config', '--target-glib=2.38'], language: 'vala') +math = cc.find_library('m', required : true) champlain = dependency('champlain-0.12') clutter_gtk = dependency('clutter-gtk-1.0') gee = dependency('gee-0.8') @@ -18,15 +22,11 @@ gnome = import('gnome') i18n = import('i18n') conf = configuration_data() -# Surround the version in quotes to make it a C string -conf.set_quoted('VERSION', meson.project_version()) -conf.set_quoted('PACKAGE_VERSION', meson.project_version()) -conf.set('ENABLE_NLS', 1) -conf.set('HAVE_DCGETTEXT', 1) -conf.set('HAVE_GETTEXT', 1) conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) conf.set_quoted('LOCALEDIR', get_option('localedir')) conf.set_quoted('LOCALSTATEDIR', get_option('localstatedir')) +conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +conf.set_quoted('VERSION', meson.project_version()) valadoc = find_program('valadoc', required : false) if valadoc.found() @@ -41,27 +41,49 @@ gresources = gnome.compile_resources( configure_file(output : 'config.h', configuration : conf) -gqpe_sources = [ +gqpe_vala_sources = [ 'src/application-window.vala', 'src/application.vala', 'src/namespace.vala', 'src/orientation.vala', 'src/photograph.vala', 'src/tag.vala', - 'src/application-main.vala', - gresources + 'src/application-main.vala' ] +gqpe_sources = gqpe_vala_sources + [ gresources ] + gqpe_dependencies = [ champlain, clutter_gtk, gee, gexiv2, - gtk + gtk, + math ] -gqpe_link_args = [ '-lm' ] - executable('src/gqpe', gqpe_sources, - dependencies: gqpe_dependencies, - link_args: gqpe_link_args) + dependencies: gqpe_dependencies) + +if valadoc.found() + docdir = 'doc' + doc = custom_target('documentation', + output: docdir, + input: gqpe_vala_sources, + command: [valadoc, + '--directory=@OUTPUT@', + '--force', + '--package-name=gqpe', + '--package-version=0.1', + '--target-glib=2.38', + '--vapidir=' + vapidir, + '--verbose', + '--pkg=champlain-0.12', + '--pkg=clutter-gtk-1.0', + '--pkg=gee-0.8', + '--pkg=gexiv2', + '--pkg=gtk+-3.0', + '--pkg=config', + '@INPUT@'], + install: false) +endif -- GitLab