2020-09-30 12:10:24 +02:00
|
|
|
if not get_option('html_manual') and not get_option('manpages')
|
2020-08-14 12:37:02 +02:00
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2020-08-14 12:35:29 +02:00
|
|
|
sphinx = find_program('sphinx-build', required: get_option('documentation'))
|
|
|
|
if not sphinx.found()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2020-08-14 12:37:02 +02:00
|
|
|
if get_option('html_manual')
|
|
|
|
sphinx_output = custom_target(
|
|
|
|
'HTML documentation',
|
|
|
|
output: 'html',
|
|
|
|
input: [
|
|
|
|
'index.rst', 'user.rst', 'developer.rst',
|
|
|
|
'plugins.rst',
|
|
|
|
'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
|
2020-04-22 19:42:06 +02:00
|
|
|
|
|
|
|
if get_option('manpages')
|
2020-08-14 13:49:16 +02:00
|
|
|
custom_target(
|
2020-04-22 19:42:06 +02:00
|
|
|
'Manpage documentation',
|
2020-09-23 14:47:21 +02:00
|
|
|
output: ['mpd.1', 'mpd.conf.5'],
|
2020-08-14 13:49:16 +02:00
|
|
|
input: ['mpd.1.rst', 'conf.py'],
|
2020-09-23 14:47:21 +02:00
|
|
|
command: [sphinx, '-q', '-b', 'man', '-d', '@OUTDIR@/man_doctrees', meson.current_source_dir(), '@OUTDIR@'],
|
2020-04-22 19:42:06 +02:00
|
|
|
build_by_default: true,
|
2020-08-14 13:49:16 +02:00
|
|
|
install: true,
|
2020-09-23 14:47:21 +02:00
|
|
|
install_dir: [join_paths(get_option('mandir'), 'man1'), join_paths(get_option('mandir'), 'man5')],
|
2020-04-22 19:42:06 +02:00
|
|
|
)
|
|
|
|
endif
|