meson.build 3.95 KB
Newer Older
1
project('gnome-contacts', [ 'vala', 'c' ],
Niels De Graef's avatar
Niels De Graef committed
2
  version: '3.36',
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
# Application ID
17
if get_option('profile') == 'development'
18
  contacts_app_id = 'org.gnome.Contacts.Devel'
19
20
else
  contacts_app_id = 'org.gnome.Contacts'
21
endif
22

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

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

Niels De Graef's avatar
Niels De Graef committed
35
36
37
38
39
40
41
# We know that compiling on a lower version doesn't work
min_vala_version = '0.40.10'
if valac.version().version_compare('<' + min_vala_version)
  error('Your Vala installation is too old (@0@).'.format(valac.version())
      + ' Please make sure you have at least Vala ' + min_vala_version)
endif

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

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

57
58
cheese_dep = dependency('cheese', required: get_option('cheese'))
cheese_gtk_dep = dependency('cheese-gtk', version: '>= 3.3.91', required: get_option('cheese'))
Niels De Graef's avatar
Niels De Graef committed
59

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

76
77
78
79
80
81
82
  # 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
83

84
85
  # We need to add this, since Vala queries the pkgconfig version on its own
  # and will error out if that is lower then required one
Niels De Graef's avatar
Niels De Graef committed
86
87
88
89
  add_project_arguments(
    [ '--disable-since-check' ],
    language: 'vala'
  )
90

91
  libhandy_vapidir = meson.build_root() / 'subprojects' / 'libhandy' / 'src'
Niels De Graef's avatar
Niels De Graef committed
92
93
else
  libhandy_vapidir = ''
94
95
endif

96
valadoc = find_program('valadoc', required: get_option('docs'))
97

98

99
100
# Configuration
conf = configuration_data()
101
conf.set_quoted('APP_ID', contacts_app_id)
102
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
Niels De Graef's avatar
Niels De Graef committed
103
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
104
105
106
107
108
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())
109
conf.set_quoted('PROFILE', get_option('profile'))
110
conf.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
111
112
configure_file(output: 'config.h', configuration: conf)

113
# Post-install scripts
114
meson.add_install_script('build-aux/meson_post_install.py')
115
116

# Subfolders
117
118
119
subdir('data')
subdir('po')
subdir('src')
120
121
122
123
if get_option('manpage')
  subdir('man')
endif
if get_option('docs')
124
125
  subdir('docs')
endif
Niels De Graef's avatar
Niels De Graef committed
126
subdir('tests')