summaryrefslogtreecommitdiff
path: root/meson.build
blob: 8cd97dbc66b2ea26c302a02cb908c4eb456c7db4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
project('gnome-contacts', [ 'vala', 'c' ],
  version: '3.27.4',
  license: 'GPL2+',
  meson_version: '>= 0.37',
)

gnome = import('gnome')
i18n = import('i18n')

# Add our custom VAPI dir
add_project_arguments(
  ['--vapidir', join_paths(meson.source_root(), 'vapi')],
  language: 'vala'
)

# Some variables
config_h_dir = include_directories('.')
contacts_prefix = get_option('prefix')
datadir = join_paths(contacts_prefix, get_option('datadir'))
bindir = join_paths(contacts_prefix, get_option('bindir'))
libdir = join_paths(contacts_prefix, get_option('libdir'))
libexecdir = join_paths(contacts_prefix, get_option('libexecdir'))
locale_dir = join_paths(contacts_prefix, get_option('localedir'))
pkgdatadir = join_paths(datadir, meson.project_name())
pkglibdir = join_paths(libdir, meson.project_name())
po_dir = join_paths(meson.source_root(), 'po')

# Dependencies
min_eds_version = '3.13.90'
min_folks_version = '0.11.4'
min_glib_version = '2.44.0'

folks = dependency('folks', version: '>=' + min_folks_version)
folks_eds = dependency('folks-eds', version: '>=' + min_folks_version)
gee = dependency('gee-0.8')
gio_unix = dependency('gio-unix-2.0', version: '>=' + min_glib_version)
glib = dependency('glib-2.0', version: '>=' + min_glib_version)
gmodule_export = dependency('gmodule-export-2.0', version: '>=' + min_glib_version)
gnome_desktop = dependency('gnome-desktop-3.0')
goa = dependency('goa-1.0')
gtk = dependency('gtk+-3.0', version: '>= 3.22.0')
libebook = dependency('libebook-1.2', version: '>=' + min_eds_version)
libedataserver = dependency('libedataserver-1.2', version: '>=' + min_eds_version)
libedataserverui = dependency('libedataserverui-1.2', version: '>=' + min_eds_version)

# Libraries
math = meson.get_compiler('c').find_library('m')

# Options
cheese_enabled = (get_option('with-cheese') != 'no')
if cheese_enabled
  cheese_required = (cheese_enabled == 'yes')
  cheese = dependency('cheese', required: cheese_required)
  cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91', required: cheese_required)
  cheese_enabled = cheese.found() and cheese_gtk.found()
endif

maps_enabled = get_option('maps')
if maps_enabled
  champlain = dependency('champlain-0.12')
  clutter_gtk = dependency('clutter-gtk-1.0')
  geocode_glib = dependency('geocode-glib-1.0', version: '>= 3.15.3')
endif

telepathy_enabled = get_option('telepathy')
if telepathy_enabled
  folks_telepathy = dependency('folks-telepathy', version: '>=' + min_folks_version)
  telepathy_glib = dependency('telepathy-glib', version: '>= 0.22.0')
endif

manpage_enabled = get_option('with-manpage')

# Configuration
conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
conf.set_quoted('LOCALEDIR', locale_dir)
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_STRING', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('PKGDATADIR', pkgdatadir)
conf.set_quoted('PKGLIBDIR', pkglibdir)
conf.set_quoted('VERSION', meson.project_version())
configure_file(output: 'config.h', configuration: conf)

# Post-install scripts
meson.add_install_script('meson_post_install.py')

# Subfolders
subdir('data')
subdir('po')
subdir('src')
subdir('man')