meson.build 2.11 KB
Newer Older
1 2 3
project(
  'gnome-clocks',
  ['vala', 'c'],
Paolo Borelli's avatar
Paolo Borelli committed
4
  version: '3.31.2',
5
  license: 'GPL2+',
6
  meson_version: '>= 0.46.0',
7 8 9 10
)

gnome = import('gnome')
i18n = import('i18n')
11
python3 = import('python3')
12 13 14 15 16 17

glib = dependency('glib-2.0', version: '>=2.44')
gio = dependency('gio-2.0', version: '>=2.44')
gobject = dependency('gobject-2.0', version: '>=2.44')
gtk = dependency('gtk+-3.0', version: '>=3.20')
gsound = dependency('gsound', version: '>=0.98')
18
gweather = dependency('gweather-3.0', version: '>=3.27.2')
19 20 21 22 23 24 25 26 27 28
gnomedesktop = dependency('gnome-desktop-3.0', version: '>=3.8')
geocodeglib = dependency('geocode-glib-1.0', version: '>=1.0')
libgeoclue = dependency('libgeoclue-2.0', version: '>=2.4')

cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)

have_first_weekday = cc.compiles('''
#include <langinfo.h>
int main() {
29
  nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
30 31
}
''',
32
  name: '_NL_TIME_FIRST_WEEKDAY check program'
33 34 35 36 37
)

msgfmt = find_program('msgfmt')
podir = join_paths(meson.source_root(), 'po')

38 39 40 41 42 43 44 45 46 47
if get_option('profile') == 'development'
  name_prefix = '(Development) '
  profile = 'Devel'
else
  name_prefix = ''
  profile = ''
endif

app_id = 'org.gnome.clocks@0@'.format(profile)

48
conf = configuration_data()
49 50 51
conf.set_quoted('APP_ID', app_id)
conf.set_quoted('G_LOG_DOMAIN', 'org.gnome.Clocks@0@'.format(profile))
conf.set_quoted('NAME_PREFIX', name_prefix)
52 53
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
54
conf.set_quoted('PROFILE', profile)
55 56 57
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
58
conf.set_quoted('GNOMELOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
59
if have_first_weekday
60
  conf.set('HAVE__NL_TIME_FIRST_WEEKDAY', '1')
61 62 63 64
endif
configure_file(output: 'config.h', configuration: conf)
config_h_dir = include_directories('.')

65 66
meson.add_install_script(python3.find_python().path(),
  join_paths(meson.source_root(), 'build-aux', 'post-install.py'))
67 68 69 70

subdir('data')
subdir('help')
subdir('po')
Paolo Borelli's avatar
Paolo Borelli committed
71
subdir('src')