meson.build 1.11 KB
Newer Older
1
if not get_option('html_manual') and not get_option('manpages')
2 3 4
  subdir_done()
endif

5 6 7 8 9
sphinx = find_program('sphinx-build', required: get_option('documentation'))
if not sphinx.found()
  subdir_done()
endif

10 11 12 13 14 15 16
if get_option('html_manual')
  sphinx_output = custom_target(
    'HTML documentation',
    output: 'html',
    input: [
      'index.rst', 'user.rst', 'developer.rst',
      'plugins.rst',
17
      'client.rst',
18 19 20 21 22 23 24 25 26
      'protocol.rst',
      'conf.py',
    ],
    command: [sphinx, '-q', '-b', 'html', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@'],
    build_by_default: true,
    install: true,
    install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
  )
endif
27 28

if get_option('manpages')
29
  custom_target(
30
    'Manpage documentation',
31
    output: ['mpd.1', 'mpd.conf.5'],
32
    input: ['mpd.1.rst', 'conf.py'],
33
    command: [sphinx, '-q', '-b', 'man', '-d', '@OUTDIR@/man_doctrees', meson.current_source_dir(), '@OUTDIR@'],
34
    build_by_default: true,
35
    install: true,
36
    install_dir: [join_paths(get_option('mandir'), 'man1'), join_paths(get_option('mandir'), 'man5')],
37 38
  )
endif