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',
|
2021-02-15 13:19:17 +01:00
|
|
|
'client.rst',
|
2020-08-14 12:37:02 +02:00
|
|
|
'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
|
2022-02-20 19:42:39 +01:00
|
|
|
|
2022-02-27 17:00:12 +01:00
|
|
|
if get_option('doxygen')
|
2022-02-20 19:42:39 +01:00
|
|
|
|
2022-02-27 17:00:12 +01:00
|
|
|
doxygen = find_program('doxygen', required: true)
|
2022-02-20 19:42:39 +01:00
|
|
|
conf_data = configuration_data()
|
|
|
|
conf_data.set('VERSION', meson.project_version())
|
|
|
|
conf_data.set('abs_top_srcdir', meson.source_root())
|
|
|
|
doxyfile = configure_file(
|
|
|
|
input: 'doxygen.conf.in',
|
|
|
|
output: 'Doxyfile',
|
|
|
|
configuration: conf_data
|
|
|
|
)
|
|
|
|
|
|
|
|
custom_target('Doxygen',
|
|
|
|
command: [doxygen, doxyfile],
|
|
|
|
output: ['api'],
|
|
|
|
build_by_default: true
|
|
|
|
)
|
|
|
|
endif
|