summaryrefslogtreecommitdiff
path: root/docs/meson.build
blob: d510464e12ffd1c68329fe4829a26d171c80252a (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
52
53
if get_option('gtk_doc')
  gnome.gtkdoc(
    'dconf',
    main_xml: 'dconf-docs.xml',
    src_dir: [
      common_inc,
      client_inc
    ],
    dependencies: libdconf_dep,
    scan_args: '--rebuild-types',
    gobject_typesfile: 'dconf.types',
    install: true,
    install_dir: join_paths(dconf_prefix, gnome.gtkdoc_html_dir('dconf')),
  )
endif

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

  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