summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2021-07-25 11:52:47 +0800
committerraveit65 <[email protected]>2021-07-30 19:02:49 +0200
commit8dca108a6a4bed0b3411e41cb04b143c71036b67 (patch)
tree35632a66e2d50c89a690e5202a2e0ff56e7285b6 /meson.build
parenta1216168706c08384154d3cea579d223fdc9e81d (diff)
downloadmate-calc-8dca108a6a4bed0b3411e41cb04b143c71036b67.tar.bz2
mate-calc-8dca108a6a4bed0b3411e41cb04b143c71036b67.tar.xz
Add build support for meson
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build65
1 files changed, 65 insertions, 0 deletions
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..d7fa021
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,65 @@
+project('mate-calc','c',
+ version: '1.25.1',
+ meson_version: '>=0.50.0',
+ license: 'GPLv3+',
+)
+
+i18n = import('i18n')
+gnome = import('gnome')
+
+po_dir = join_paths(meson.source_root(), 'po')
+datadir = join_paths([ get_option('prefix'),get_option('datadir') ])
+pkgdatadir = join_paths([ get_option('prefix'),get_option('datadir'),'mate-calc' ])
+bindir = join_paths([ get_option('prefix'), 'bin' ])
+schemadir = join_paths([ datadir, 'glib-2.0', 'schemas' ])
+locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
+
+# Dependencies
+glib_min_version = '2.40.0'
+
+gio = dependency('gio-2.0', version: '>= ' + glib_min_version)
+glib = dependency('glib-2.0', version: '>= ' + glib_min_version)
+gobject = dependency('gobject-2.0', version: '>= ' + glib_min_version)
+libxml = dependency('libxml-2.0')
+gtk = dependency('gtk+-3.0', version : '>=3.22')
+
+# Libraries
+cc = meson.get_compiler('c')
+mpc = declare_dependency(
+ dependencies: [
+ cc.find_library('mpc'),
+ ]
+)
+mpfr = declare_dependency(
+ dependencies: [
+ cc.find_library('mpfr'),
+ ]
+)
+conf = configuration_data()
+
+top_inc = include_directories('.')
+
+conf.set('G_LOG_USE_STRUCTURED', true)
+conf.set_quoted('PACKAGE_NAME', 'mate-calc')
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('GETTEXT_PACKAGE', 'mate-calc')
+conf.set_quoted('PACKAGE_URL', 'https://mate-desktop.org')
+conf.set_quoted('DATADIR', datadir)
+conf.set_quoted('UI_DIR', join_paths([pkgdatadir,'uidir']))
+conf.set_quoted('PKGDATADIR', pkgdatadir)
+conf.set_quoted('LOCALE_DIR', join_paths([ get_option('prefix'),
+ get_option('datadir'),
+ 'locale' ]))
+
+conf.set_quoted('pkgdatadir', pkgdatadir)
+conf.set_quoted('bindir', bindir)
+
+configure_file(output : 'config.h', configuration : conf)
+
+subdir('src')
+subdir('data')
+subdir('po')
+subdir('help')
+
+meson.add_install_script('meson-postinstall.sh')