1project('xed', 'c', version : '3.2.0')
2
3gnome = import('gnome')
4i18n = import('i18n')
5pkgconfig = import('pkgconfig')
6
7version = meson.project_version()
8
9xed_conf = configuration_data()
10xed_conf.set_quoted('VERSION', version)
11#xed_conf.set_quoted('GETTEXT_PACKAGE', 'xed')
12xed_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
13
14# directories
15prefix = get_option('prefix')
16bindir = get_option('bindir')
17datadir = get_option('datadir')
18libdir = get_option('libdir')
19includedir = get_option('includedir')
20libexecdir = get_option('libexecdir')
21desktopdir = join_paths(datadir, 'applications')
22schema_dir = join_paths(datadir, 'glib-2.0', 'schemas')
23
24po_dir = join_paths(meson.source_root(), 'po')
25
26# dependencies
27libxml = dependency('libxml-2.0', version: '>= 2.5.0')
28glib = dependency('glib-2.0', version: '>= 2.40.0')
29gthread = dependency('gthread-2.0', version: '>= 2.13.0')
30gio = dependency('gio-2.0', version: '>= 2.40.0')
31gtk = dependency('gtk+-3.0', version: '>= 3.19.3')
32gtksourceview = dependency('gtksourceview-4', version: '>= 4.0.3')
33libpeas = dependency('libpeas-1.0', version: '>= 1.12.0')
34libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.12.0')
35gir_dep = dependency('gobject-introspection-1.0', version: '>= 1.42.0', required: false)
36gmodule = dependency('gmodule-2.0')
37xapp = dependency('xapp', version: '>= 1.9.0')
38X11 = dependency('x11')
39pango = dependency('pango')
40
41if gir_dep.found()
42    xed_conf.set('ENABLE_INTROSPECTION', 1)
43endif
44
45enable_spell = get_option('enable_spell')
46if enable_spell
47    gspell = dependency('gspell-1', version: '>= 0.2.5')
48endif
49
50if get_option('enable_gvfs_metadata')
51    xed_conf.set('ENABLE_GVFS_METADATA', true)
52endif
53
54# on some systems we need to find the math lib to make sure it builds
55cc = meson.get_compiler('c')
56math = cc.find_library('m', required: false)
57
58intltool_merge = find_program('intltool-merge')
59itstool = find_program('itstool')
60
61# generate config.h
62config_h_file = configure_file(
63    output : 'config.h',
64    configuration : xed_conf
65)
66
67config_h = declare_dependency(
68    sources: config_h_file
69)
70
71include_dirs = include_directories('.', 'xed')
72
73# compiler flags
74add_global_arguments('-DDATADIR="@0@"'.format(join_paths(prefix, datadir)), language: 'c')
75add_global_arguments('-DLIBDIR="@0@"'.format(join_paths(prefix, libdir)), language: 'c')
76
77# remove this later or add as build option
78if not get_option('deprecated_warnings')
79    add_global_arguments([
80            '-Wno-deprecated-declarations',
81            '-Wno-deprecated',
82            '-Wno-declaration-after-statement',
83        ],
84        language: 'c',
85    )
86endif
87
88subdir('xed')
89subdir('pixmaps')
90subdir('po')
91subdir('data')
92subdir('plugins')
93subdir('help')
94if get_option('docs')
95    subdir('docs/reference')
96endif
97
98# The tests use an option that doesn't exist in meson before 0.46.
99# Since they aren't strictly necessary, we'll just skip them for earlier versions
100# rather than making 0.46 a hard requirement. This condition can be removed once we
101# no longer need to worry about building on 0.45 or earlier
102meson_version_parts = meson.version().split('.')
103if meson_version_parts[0].to_int() > 0 or meson_version_parts[1].to_int() >= 46
104    subdir('test')
105endif
106
107message('prefix = @0@'.format(prefix))
108message('bindir = @0@'.format(bindir))
109message('datadir = @0@'.format(datadir))
110message('libdir = @0@'.format(libdir))
111message('includedir = @0@'.format(includedir))
112message('libexecdir = @0@'.format(libexecdir))
113message('desktopdir = @0@'.format(desktopdir))
114message('schema_dir = @0@'.format(schema_dir))
115