meson.build 3.79 KB
Newer Older
1
project('gnome-contacts', [ 'vala', 'c' ],
2
  version: '3.33.91',
3
  license: 'GPL2+',
4
  meson_version: '>= 0.41',
5
6
7
8
9
10
11
12
13
14
15
)

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

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

16
# Options
17
cheese_enabled = get_option('cheese')
18
19
telepathy_enabled = get_option('telepathy')
docs_enabled = get_option('docs')
20
manpage_enabled = get_option('manpage')
21
22

# Common variables
23
24
contacts_app_id = 'org.gnome.Contacts'

25
config_h_dir = include_directories('.')
26
27
28
29
30
31
32
33
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())
34
35
36
po_dir = join_paths(meson.source_root(), 'po')

# Dependencies
37
38
min_eds_version = '3.13.90'
min_folks_version = '0.11.4'
39
min_glib_version = '2.44' # We also use this value for --target-glib, so scratch the micro version.
40

41
42
math = meson.get_compiler('c').find_library('m')

43
44
folks = dependency('folks', version: '>=' + min_folks_version)
folks_eds = dependency('folks-eds', version: '>=' + min_folks_version)
45
gee = dependency('gee-0.8')
46
47
48
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)
49
50
gnome_desktop = dependency('gnome-desktop-3.0')
goa = dependency('goa-1.0')
Adrien Plazas's avatar
Adrien Plazas committed
51
gtk = dependency('gtk+-3.0', version: '>= 3.23.1')
52
53
54
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)
55

56
if cheese_enabled
57
58
  cheese = dependency('cheese')
  cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91')
59
endif
Niels De Graef's avatar
Niels De Graef committed
60

61
62
63
64
65
if telepathy_enabled
  folks_telepathy = dependency('folks-telepathy', version: '>=' + min_folks_version)
  telepathy_glib = dependency('telepathy-glib', version: '>= 0.22.0')
endif

Adrien Plazas's avatar
Adrien Plazas committed
66
libhandy = dependency('libhandy-0.0', version: '>= 0.0.9', required: false)
67
68
69
70
71
if not libhandy.found()
  libhandy_subproj = subproject(
    'libhandy',
    default_options: [
      'examples=false',
Adrien Plazas's avatar
Adrien Plazas committed
72
      'glade_catalog=disabled',
73
74
75
      'tests=false',
    ]
  )
Niels De Graef's avatar
Niels De Graef committed
76

77
78
79
80
81
82
83
  # When using libhandy as subproject, make sure we get the VAPI file
  libhandy = declare_dependency(
    dependencies: [
      libhandy_subproj.get_variable('libhandy_dep'),
      libhandy_subproj.get_variable('libhandy_vapi'),
    ]
  )
Niels De Graef's avatar
Niels De Graef committed
84
85
86
87

  libhandy_vapidir = join_paths(meson.build_root(), 'subprojects', 'libhandy', 'src')
else
  libhandy_vapidir = ''
88
89
endif

90
91
valadoc = find_program('valadoc', required: docs_enabled)

92

93
94
# Configuration
conf = configuration_data()
95
conf.set_quoted('APP_ID', contacts_app_id)
96
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
Niels De Graef's avatar
Niels De Graef committed
97
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
98
99
100
101
102
103
104
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())
105
conf.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
106
107
configure_file(output: 'config.h', configuration: conf)

108
# Post-install scripts
109
meson.add_install_script('build-aux/meson_post_install.py')
110
111

# Subfolders
112
113
114
115
subdir('data')
subdir('po')
subdir('src')
subdir('man')
116
117
118
if docs_enabled
  subdir('docs')
endif
Niels De Graef's avatar
Niels De Graef committed
119
subdir('tests')