From 79694263bb62ae5ae4833b10dd2ec0b9f4c77b26 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 8 Jun 2017 09:50:54 +0200 Subject: Support meson build system --- src/config.h.meson.in | 1 + src/meson.build | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/config.h.meson.in create mode 100644 src/meson.build (limited to 'src') diff --git a/src/config.h.meson.in b/src/config.h.meson.in new file mode 100644 index 0000000..33cacf6 --- /dev/null +++ b/src/config.h.meson.in @@ -0,0 +1 @@ +#mesondefine UCA_PLUGINDIR diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..574e8e5 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,61 @@ +sources = [ + 'uca-camera.c', + 'uca-plugin-manager.c', + 'uca-ring-buffer.c' +] + +headers = [ + 'uca-camera.h', + 'uca-plugin-manager.h', +] + +plugindir = '@0@/@1@/uca'.format(get_option('prefix'), get_option('libdir')) + +conf = configuration_data() +conf.set_quoted('UCA_PLUGINDIR', plugindir) + +configure_file( + input: 'config.h.meson.in', + output: 'config.h', + configuration: conf +) + +enums = gnome.mkenums('uca-enums', + sources: headers, + h_template: 'uca-enums.h.template', + c_template: 'uca-enums.c.template', + install_header: true, + install_dir: '', # this is horrible but works and prefixes correctly +) + +enums_c = enums[0] +enums_h = enums[1] + +sources += [enums_c, enums_h] + +lib = shared_library('uca', + sources: sources, + dependencies: [glib_dep, gobject_dep, gmodule_dep, gio_dep], + version: version, + soversion: version_major +) + +gnome.generate_gir(lib, + namespace: 'Uca', + nsversion: '@0@.0'.format(version_major), + sources: sources, + install: true, +) + +pkg = import('pkgconfig') + +pkg.generate( + libraries: [lib], + version: version, + name: 'libuca', + description: 'Library for unified scientific camera access', + requires: ['glib-2.0', 'gobject-2.0'], + variables: ['plugindir=${libdir}/uca'], +) + +install_headers(headers, subdir: 'uca') -- cgit v1.2.3