summaryrefslogtreecommitdiff
path: root/docs/meson.build
blob: d74eedf8027f13d50f74756063beac5d20467c94 (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
gnome.gtkdoc(
  meson.project_name(),
  main_xml: meson.project_name() + '-docs.xml',
  src_dir: [
    common_inc,
    client_inc
  ],
  dependencies: libdconf_dep,
  scan_args: '--rebuild-types',
  gobject_typesfile: meson.project_name() + '.types',
  install: true,
  install_dir: join_paths(dconf_datadir, 'gtk-doc', 'html', meson.project_name())
)

if get_option('enable-man')
  xsltproc = find_program('xsltproc', required: false)
  assert(xsltproc.found(), 'xsltproc is required for enable-man')

  xsltproc_cmd = [
    xsltproc,
    '--output', '@OUTPUT@',
    '--nonet',
    '--stringparam', 'man.output.quietly', '1',
    '--stringparam', 'funcsynopsis.style', 'ansi',
    '--stringparam', 'man.th.extra1.suppress', '1',
    '--stringparam', 'man.authors.section.enabled', '0',
    '--stringparam', 'man.copyright.section.enabled', '0',
    'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
    '@INPUT@'
  ]

  mans = [
    ['dconf-service.xml', 'dconf-service', '1'],
    ['dconf-tool.xml', 'dconf', '1'],
    ['dconf-overview.xml', 'dconf', '7']
  ]

  foreach man: mans
    output = '@0@.@1@'.format(man[1], man[2])
    man_dir = 'man' + man[2]

    custom_target(
      output,
      input: man[0],
      output: output,
      command: xsltproc_cmd,
      install: true,
      install_dir: join_paths(dconf_mandir, man_dir)
    )
  endforeach
endif