meson.build 3.38 KB
Newer Older
1
project('gnome-contacts', [ 'vala', 'c' ],
2
  version: '3.35.1',
3
  license: 'GPL2+',
4
  meson_version: '>= 0.50',
5
6
7
8
9
10
11
)

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

# Add our custom VAPI dir
add_project_arguments(
12
  ['--vapidir', meson.source_root() / 'vapi'],
13
14
15
  language: 'vala'
)

16
17
18
19
20
21
# Application ID
if get_option('profile') == 'default'
  contacts_app_id = 'org.gnome.Contacts'
else
  contacts_app_id = 'org.gnome.Contacts.Devel'
endif
22

23
# Common variables
24
config_h_dir = include_directories('.')
25
contacts_prefix = get_option('prefix')
26
27
locale_dir = contacts_prefix / get_option('localedir')
po_dir = meson.source_root() / 'po'
28
29

# Dependencies
30
31
min_eds_version = '3.13.90'
min_folks_version = '0.11.4'
32
min_glib_version = '2.44' # We also use this value for --target-glib, so scratch the micro version.
33

34
35
math = meson.get_compiler('c').find_library('m')

36
37
folks = dependency('folks', version: '>=' + min_folks_version)
folks_eds = dependency('folks-eds', version: '>=' + min_folks_version)
38
gee = dependency('gee-0.8')
39
40
41
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)
42
43
gnome_desktop = dependency('gnome-desktop-3.0')
goa = dependency('goa-1.0')
Adrien Plazas's avatar
Adrien Plazas committed
44
gtk = dependency('gtk+-3.0', version: '>= 3.23.1')
45
46
47
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)
48

49
if get_option('cheese')
50
51
  cheese = dependency('cheese')
  cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91')
52
endif
Niels De Graef's avatar
Niels De Graef committed
53

54
if get_option('telepathy')
55
56
57
58
  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
59
libhandy = dependency('libhandy-0.0', version: '>= 0.0.12', required: false)
60
61
62
63
64
if not libhandy.found()
  libhandy_subproj = subproject(
    'libhandy',
    default_options: [
      'examples=false',
Adrien Plazas's avatar
Adrien Plazas committed
65
      'glade_catalog=disabled',
66
67
68
      'tests=false',
    ]
  )
Niels De Graef's avatar
Niels De Graef committed
69

70
71
72
73
74
75
76
  # 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
77

78
  libhandy_vapidir = meson.build_root() / 'subprojects' / 'libhandy' / 'src'
Niels De Graef's avatar
Niels De Graef committed
79
80
else
  libhandy_vapidir = ''
81
82
endif

83
valadoc = find_program('valadoc', required: get_option('docs'))
84

85

86
87
# Configuration
conf = configuration_data()
88
conf.set_quoted('APP_ID', contacts_app_id)
89
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
Niels De Graef's avatar
Niels De Graef committed
90
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
91
92
93
94
95
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('VERSION', meson.project_version())
96
conf.set_quoted('PROFILE', get_option('profile'))
97
conf.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
98
99
configure_file(output: 'config.h', configuration: conf)

100
# Post-install scripts
101
meson.add_install_script('build-aux/meson_post_install.py')
102
103

# Subfolders
104
105
106
subdir('data')
subdir('po')
subdir('src')
107
108
109
110
if get_option('manpage')
  subdir('man')
endif
if get_option('docs')
111
112
  subdir('docs')
endif
Niels De Graef's avatar
Niels De Graef committed
113
subdir('tests')