meson.build 3.89 KB
Newer Older
1
project('gnome-contacts', [ 'vala', 'c' ],
Niels De Graef's avatar
Niels De Graef committed
2
  version: '3.38.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
  # 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
  '--disable-since-check',
16
17
18
  language: 'vala'
)

19
# Application ID
20
if get_option('profile') == 'development'
21
  contacts_app_id = 'org.gnome.Contacts.Devel'
22
23
else
  contacts_app_id = 'org.gnome.Contacts'
24
endif
25

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

# Dependencies
34
min_eds_version = '3.30'
35
min_folks_version = '0.14'
36
min_glib_version = '2.58' # We also use this value for --target-glib, so scratch the micro version.
37

Niels De Graef's avatar
Niels De Graef committed
38
39
40
41
42
43
44
# 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

45
46
math = meson.get_compiler('c').find_library('m')

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

60
61
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
62

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

79
80
81
82
83
84
85
  # 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
86

87
  libhandy_vapidir = meson.build_root() / 'subprojects' / 'libhandy' / 'src'
Niels De Graef's avatar
Niels De Graef committed
88
89
else
  libhandy_vapidir = ''
90
91
endif

92
valadoc = find_program('valadoc', required: get_option('docs'))
93

94

95
96
# Configuration
conf = configuration_data()
97
conf.set_quoted('APP_ID', contacts_app_id)
98
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
Niels De Graef's avatar
Niels De Graef committed
99
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
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('VERSION', meson.project_version())
105
conf.set_quoted('PROFILE', get_option('profile'))
106
conf.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
107
108
configure_file(output: 'config.h', configuration: conf)

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

# Subfolders
113
114
115
subdir('data')
subdir('po')
subdir('src')
116
117
118
119
if get_option('manpage')
  subdir('man')
endif
if get_option('docs')
120
121
  subdir('docs')
endif
Niels De Graef's avatar
Niels De Graef committed
122
subdir('tests')