diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-06-08 09:50:54 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-06-08 09:50:54 +0200 |
commit | 79694263bb62ae5ae4833b10dd2ec0b9f4c77b26 (patch) | |
tree | 5e7ffc25fa4d692ec753190db29b2df4c2450ab8 | |
parent | 5720d2d8a15d72257c1d073fae6e51e1222b650d (diff) | |
download | uca-79694263bb62ae5ae4833b10dd2ec0b9f4c77b26.tar.gz uca-79694263bb62ae5ae4833b10dd2ec0b9f4c77b26.tar.bz2 uca-79694263bb62ae5ae4833b10dd2ec0b9f4c77b26.tar.xz uca-79694263bb62ae5ae4833b10dd2ec0b9f4c77b26.zip |
Support meson build system
-rw-r--r-- | bin/meson.build | 1 | ||||
-rw-r--r-- | bin/tools/meson.build | 23 | ||||
-rw-r--r-- | meson.build | 25 | ||||
-rw-r--r-- | plugins/file/meson.build | 10 | ||||
-rw-r--r-- | plugins/meson.build | 2 | ||||
-rw-r--r-- | plugins/mock/meson.build | 10 | ||||
-rw-r--r-- | src/config.h.meson.in | 1 | ||||
-rw-r--r-- | src/meson.build | 61 |
8 files changed, 133 insertions, 0 deletions
diff --git a/bin/meson.build b/bin/meson.build new file mode 100644 index 0000000..f39afc8 --- /dev/null +++ b/bin/meson.build @@ -0,0 +1 @@ +subdir('tools') diff --git a/bin/tools/meson.build b/bin/tools/meson.build new file mode 100644 index 0000000..3ae20d6 --- /dev/null +++ b/bin/tools/meson.build @@ -0,0 +1,23 @@ +executable('uca-info', + sources: ['info.c'], + include_directories: include_dir, + dependencies: deps, + link_with: lib, + install: true +) + +executable('uca-grab', + sources: ['grab.c', 'common.c'], + include_directories: include_dir, + dependencies: deps, + link_with: lib, + install: true +) + +executable('uca-benchmark', + sources: ['benchmark.c', 'common.c'], + include_directories: include_dir, + dependencies: deps, + link_with: lib, + install: true +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..02a8806 --- /dev/null +++ b/meson.build @@ -0,0 +1,25 @@ +project('libuca', 'c', + version: '2.2.1' +) + +version = meson.project_version() +components = version.split('.') +version_major = components[0] +version_minor = components[1] +version_patch = components[2] + +gnome = import('gnome') + +glib_dep = dependency('glib-2.0', version: '>= 2.28') +gio_dep = dependency('gio-2.0', version: '>= 2.28') +gobject_dep = dependency('gobject-2.0', version: '>= 2.28') +gmodule_dep = dependency('gmodule-2.0', version: '>= 2.28') + +deps = [glib_dep, gio_dep, gobject_dep, gmodule_dep] + +subdir('src') + +include_dir = include_directories('src') + +subdir('bin') +subdir('plugins') diff --git a/plugins/file/meson.build b/plugins/file/meson.build new file mode 100644 index 0000000..525a06c --- /dev/null +++ b/plugins/file/meson.build @@ -0,0 +1,10 @@ +tiff_dep = dependency('libtiff-4') + +plugin = shared_library('ucafile', + sources: ['uca-file-camera.c'], + include_directories: include_dir, + dependencies: deps + [tiff_dep], + link_with: lib, + install: true, + install_dir: plugindir, +) diff --git a/plugins/meson.build b/plugins/meson.build new file mode 100644 index 0000000..c13fce6 --- /dev/null +++ b/plugins/meson.build @@ -0,0 +1,2 @@ +subdir('file') +subdir('mock') diff --git a/plugins/mock/meson.build b/plugins/mock/meson.build new file mode 100644 index 0000000..1f74002 --- /dev/null +++ b/plugins/mock/meson.build @@ -0,0 +1,10 @@ +libm = meson.get_compiler('c').find_library('m') + +plugin = shared_library('ucamock', + sources: ['uca-mock-camera.c'], + include_directories: include_dir, + dependencies: deps + [libm], + link_with: lib, + install: true, + install_dir: plugindir, +) 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') |