a6c70283c1b0c36310334402d47e60effe2c3c2b
[protos/libecoli.git] / doc / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2019, Olivier MATZ <zer0@droids-corp.org>
3
4 doc_install_dir = join_paths('share', 'doc', 'libecoli')
5
6 doxygen = find_program('doxygen', required : false)
7 if not doxygen.found()
8   error('MESON_SKIP_TEST doxygen not found.')
9 endif
10
11 cdata = configuration_data()
12 cdata.set('VERSION', meson.project_version())
13 cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api'))
14 cdata.set('TOPDIR', meson.source_root())
15
16 doxygen_conf = configure_file(
17   input: 'Doxyfile.in',
18   output: 'Doxyfile',
19   configuration: cdata,
20   install: false)
21
22 doxygen_build = custom_target(
23   'doxygen',
24   input: doxygen_conf,
25   output: 'api',
26   command: [doxygen, '@INPUT@', '@OUTPUT@'],
27   build_by_default: true,
28   install_dir: doc_install_dir)
29
30 sphinx_build = find_program(
31   'sphinx-build', required: get_option('build_doc'))
32 if get_option('build_doc') and sphinx_build.found()
33         html_doc = custom_target('html_doc',
34                 input: meson.current_source_dir(),
35                 output: 'html_doc',
36                 command: [sphinx_build, '@INPUT@', '@OUTPUT@'],
37                 install: get_option('build_doc'),
38                 install_dir: doc_install_dir)
39 endif