summaryrefslogtreecommitdiffstats
path: root/doc/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-05-14 20:03:30 -0400
committerDavid Robillard <d@drobilla.net>2023-05-14 20:03:30 -0400
commitd564baafed0863813a87d872f8663134e74228c8 (patch)
tree69c80abc4ed6d011beac6a2904938830024dc220 /doc/meson.build
parent99540a8f30408d15339ececc4c28f27e2e2f06ab (diff)
downloadlilv-d564baafed0863813a87d872f8663134e74228c8.tar.gz
lilv-d564baafed0863813a87d872f8663134e74228c8.tar.bz2
lilv-d564baafed0863813a87d872f8663134e74228c8.zip
Clean up documentation and remove junk files from install
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build58
1 files changed, 50 insertions, 8 deletions
diff --git a/doc/meson.build b/doc/meson.build
index 7c633a0..787ab4f 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -3,22 +3,64 @@
docdir = get_option('datadir') / 'doc'
+# Find required programs
doxygen = find_program('doxygen', required: get_option('docs'))
-sphinxygen = find_program('sphinxygen', required: false)
sphinx_build = find_program('sphinx-build', required: get_option('docs'))
-if not sphinxygen.found()
- subproject('sphinxygen')
- sphinxygen = find_program('sphinxygen', required: get_option('docs'))
+# Find sphinxygen or fall back to subproject
+sphinxygen = disabler()
+if doxygen.found() and sphinx_build.found()
+ sphinxygen = find_program('sphinxygen', required: false)
+ if not sphinxygen.found()
+ subproject('sphinxygen')
+ sphinxygen = find_program('sphinxygen', required: get_option('docs'))
+ endif
endif
+# Build documentation if all required tools are found
build_docs = doxygen.found() and sphinxygen.found() and sphinx_build.found()
-
if build_docs
- subdir('c')
+ # Configure conf.py for Sphinx
+ conf_config = configuration_data()
+ conf_config.set('LILV_SRCDIR', lilv_src_root)
+ conf_config.set('LILV_TITLE', get_option('title'))
+ conf_config.set('LILV_VERSION', meson.project_version())
+ conf_py = configure_file(
+ configuration: conf_config,
+ input: files('conf.py.in'),
+ output: 'conf.py',
+ )
+
+ # Copy hand-written documentation files
+ c_rst_files = files(
+ 'index.rst',
+ 'overview.rst',
+ 'plugins.rst',
+ 'uis.rst',
+ 'world.rst',
+ )
+ foreach f : c_rst_files
+ configure_file(copy: true, input: f, output: '@PLAINNAME@')
+ endforeach
+
+ # Generate reference documentation input with Doxygen and Sphinxygen
+ subdir('xml')
+ subdir('api')
+
+ # Build strict Sphinx flags, with termination on warnings if werror=true
+ sphinx_flags = ['-E', '-a', '-q']
+ if get_option('werror')
+ sphinx_flags += ['-W']
+ endif
+
+ # Run Sphinx to generate final documentation for each format
+ foreach format : ['html', 'singlehtml']
+ if not get_option(format).disabled()
+ subdir(format)
+ endif
+ endforeach
endif
if not meson.is_subproject()
- summary('Documentation', build_docs, bool_yn: true)
+ summary('Documentation', build_docs, bool_yn: true, section: 'Components')
endif
-