summaryrefslogtreecommitdiff
path: root/meson.build
blob: 019a86473ca2c1d07068bc8697302b12a3e6cab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
project('dont-hang', 'c',
  license : 'CC0',
  version : '1.2')

incdir = include_directories('.')

gtkdep = dependency('gtk+-3.0', version : '>= 3.18')

cdata = configuration_data()
cdata.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
cdata.set('ENABLE_BIDI_SUPPORT', 1)
cdata.set('ENABLE_NLS', 1) # enable internationalization (i18n)
cdata.set('GETTEXT_PACKAGE', '"dont-hang"')

configure_file(output : 'config.h',
               configuration : cdata)

subdir('po')

executable('dont-hang', 'hangman.c',
  dependencies : gtkdep,
  include_directories : incdir,
  install : true,
  gui_app : true)

if host_machine.system() != 'windows'
  datadir = get_option('datadir')
  appdatadir = join_paths(datadir, 'metainfo')
  desktopdir = join_paths(datadir, 'applications')

  icon_resolutions = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
  foreach res : icon_resolutions
    path = join_paths('icons', 'hicolor', res, 'apps')
    install_data(join_paths(path, 'donthang.png'), install_dir : join_paths(datadir, path))
  endforeach

  i18n.merge_file('appdata',
    input : 'de.pelzflorian.DontHang.appdata.xml.in',
    output : 'de.pelzflorian.DontHang.appdata.xml',
    install : true,
    install_dir : appdatadir,
    po_dir : 'po')

  i18n.merge_file('desktop',
    input : 'de.pelzflorian.DontHang.desktop.in',
    output : 'de.pelzflorian.DontHang.desktop',
    install : true,
    install_dir : desktopdir,
    po_dir : 'po',
    type : 'desktop')
endif