summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-07-12 16:49:46 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-07-12 16:49:46 +0200
commit23a8520810451bff7f4cc85e69b3cfdb9b405ede (patch)
tree7f2f88854f353bac4e0e805280c329a898558d4f
parent22ebeea72338a65c1bbccb881af0767712369cc5 (diff)
Add meson build system
-rw-r--r--bin/meson.build15
-rw-r--r--config.h.meson.in7
-rw-r--r--meson.build61
-rw-r--r--ufo/meson.build124
4 files changed, 207 insertions, 0 deletions
diff --git a/bin/meson.build b/bin/meson.build
new file mode 100644
index 0000000..7b0dddd
--- /dev/null
+++ b/bin/meson.build
@@ -0,0 +1,15 @@
+progs = [['ufo-launch', ['ufo-launch.c']],
+ ['ufo-query', ['ufo-query.c']],
+ ['ufo-runjson', ['ufo-runjson.c']],
+ ['ufod', ['ufod.c']]]
+
+foreach p: progs
+ executable(p[0],
+ sources: p[1],
+ include_directories: include_dir,
+ dependencies: deps,
+ link_with: lib,
+ install: true
+ )
+endforeach
+
diff --git a/config.h.meson.in b/config.h.meson.in
new file mode 100644
index 0000000..8370320
--- /dev/null
+++ b/config.h.meson.in
@@ -0,0 +1,7 @@
+#mesondefine WITH_PYTHON
+#mesondefine WITH_ZMQ
+#mesondefine WITH_MPI
+#mesondefine HAVE_VIENNACL
+#mesondefine UFO_PLUGIN_DIR
+#mesondefine UFO_KERNEL_DIR
+#mesondefine UFO_VERSION
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..a845869
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,61 @@
+project('ufo', 'c',
+ version: '0.13.0'
+)
+
+version = meson.project_version()
+components = version.split('.')
+version_major = components[0]
+version_minor = components[1]
+version_patch = components[2]
+
+cc = meson.get_compiler('c')
+
+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')
+json_dep = dependency('json-glib-1.0', version: '>= 0.10.0')
+python_dep = dependency('python', required: false)
+zmq_dep = dependency('libzmq', required: false)
+
+opencl_dep = declare_dependency(dependencies: cc.find_library('OpenCL'))
+
+deps = [
+ glib_dep,
+ gio_dep,
+ gobject_dep,
+ gmodule_dep,
+ json_dep,
+ opencl_dep,
+ python_dep,
+ zmq_dep,
+]
+
+include_dir = include_directories('.')
+
+plugindir = '@0@/@1@/ufo'.format(get_option('prefix'), get_option('libdir'))
+kerneldir = '@0@/@1@/ufo'.format(get_option('prefix'), get_option('datadir'))
+header_subdir = 'ufo-@0@'.format(version_major)
+
+conf = configuration_data()
+conf.set_quoted('UFO_PLUGIN_DIR', plugindir)
+conf.set_quoted('UFO_KERNEL_DIR', kerneldir)
+conf.set_quoted('UFO_VERSION', version)
+conf.set('WITH_PYTHON', python_dep.found())
+conf.set('WITH_ZMQ', zmq_dep.found())
+
+configure_file(
+ input: 'config.h.meson.in',
+ output: 'config.h',
+ configuration: conf
+)
+
+add_global_arguments('-DUFO_COMPILATION', language: 'c')
+add_global_arguments('-DCL_USE_DEPRECATED_OPENCL_1_1_APIS', language: 'c')
+add_global_arguments('-DCL_USE_DEPRECATED_OPENCL_1_2_APIS', language: 'c')
+add_global_arguments('-DGLIB_DISABLE_DEPRECATION_WARNINGS', language: 'c')
+
+subdir('ufo')
+subdir('bin')
diff --git a/ufo/meson.build b/ufo/meson.build
new file mode 100644
index 0000000..6178a4f
--- /dev/null
+++ b/ufo/meson.build
@@ -0,0 +1,124 @@
+sources = [
+ 'compat.c',
+ 'ufo-base-scheduler.c',
+ 'ufo-basic-ops.c',
+ 'ufo-buffer.c',
+ 'ufo-copy-task.c',
+ 'ufo-copyable-iface.c',
+ 'ufo-cpu-node.c',
+ 'ufo-daemon.c',
+ 'ufo-dummy-task.c',
+ 'ufo-fixed-scheduler.c',
+ 'ufo-gpu-node.c',
+ 'ufo-graph.c',
+ 'ufo-group.c',
+ 'ufo-group-scheduler.c',
+ 'ufo-input-task.c',
+ 'ufo-local-scheduler.c',
+ 'ufo-messenger-iface.c',
+ 'ufo-method-iface.c',
+ 'ufo-node.c',
+ 'ufo-output-task.c',
+ 'ufo-plugin-manager.c',
+ 'ufo-priv.c',
+ 'ufo-profiler.c',
+ 'ufo-processor.c',
+ 'ufo-remote-node.c',
+ 'ufo-remote-task.c',
+ 'ufo-resources.c',
+ 'ufo-scheduler.c',
+ 'ufo-task-iface.c',
+ 'ufo-task-graph.c',
+ 'ufo-task-node.c',
+ 'ufo-transform-iface.c',
+ 'ufo-two-way-queue.c',
+]
+
+headers = [
+ 'ufo-base-scheduler.h',
+ 'ufo-basic-ops.h',
+ 'ufo-buffer.h',
+ 'ufo-copy-task.h',
+ 'ufo-copyable-iface.h',
+ 'ufo-cpu-node.h',
+ 'ufo-daemon.h',
+ 'ufo-dummy-task.h',
+ 'ufo-fixed-scheduler.h',
+ 'ufo-gpu-node.h',
+ 'ufo-graph.h',
+ 'ufo-group.h',
+ 'ufo-group-scheduler.h',
+ 'ufo-input-task.h',
+ 'ufo-local-scheduler.h',
+ 'ufo-messenger-iface.h',
+ 'ufo-method-iface.h',
+ 'ufo-node.h',
+ 'ufo-output-task.h',
+ 'ufo-plugin-manager.h',
+ 'ufo-profiler.h',
+ 'ufo-processor.h',
+ 'ufo-remote-node.h',
+ 'ufo-remote-task.h',
+ 'ufo-resources.h',
+ 'ufo-scheduler.h',
+ 'ufo-task-iface.h',
+ 'ufo-task-graph.h',
+ 'ufo-task-node.h',
+ 'ufo-transform-iface.h',
+ 'ufo-two-way-queue.h',
+]
+
+enums = gnome.mkenums('ufo-enums',
+ sources: headers,
+ h_template: 'ufo-enums.h.template',
+ c_template: 'ufo-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]
+
+if zmq_dep.found()
+ sources += ['ufo-zmq-messenger.c']
+endif
+
+m_dep = declare_dependency(
+ dependencies: cc.find_library('m')
+)
+
+lib = shared_library('ufo',
+ sources: sources,
+ dependencies: deps + [m_dep],
+ version: version,
+ soversion: version_major,
+ include_directories: include_dir,
+ install: true,
+)
+
+pkg = import('pkgconfig')
+
+pkg.generate(
+ libraries: [lib],
+ version: version,
+ name: 'ufo',
+ description: 'Library for unified scientific camera access',
+ requires: [
+ 'glib-2.0',
+ 'gobject-2.0',
+ 'gmodule-2.0',
+ 'gio-2.0',
+ 'json-glib-1.0',
+ ],
+ variables: [
+ 'plugindir=${libdir}/ufo',
+ 'kerneldir=${prefix}/@0@/ufo'.format(get_option('datadir')),
+ ],
+ subdirs: [
+ header_subdir
+ ],
+)
+
+install_headers(headers, subdir: header_subdir)