api documentation for ec_parse
[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 cdata = configuration_data()
7 cdata.set('VERSION', meson.project_version())
8 cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api'))
9 cdata.set('TOPDIR', meson.source_root())
10
11 doxygen = find_program('doxygen',
12         required : get_option('build_doc'))
13
14 sphinx_build = find_program(
15   'sphinx-build', required: get_option('build_doc'))
16
17 if get_option('build_doc')
18         doxygen_conf = configure_file(
19           input: 'Doxyfile.in',
20           output: 'Doxyfile',
21           configuration: cdata,
22           install: false)
23
24         doxygen_build = custom_target(
25           'doxygen',
26           input: doxygen_conf,
27           output: 'api',
28           command: [doxygen, '@INPUT@', '@OUTPUT@'],
29           build_by_default: true,
30           install_dir: doc_install_dir)
31
32         html_doc = custom_target('html_doc',
33                 input: meson.current_source_dir(),
34                 output: 'html_doc',
35                 command: [sphinx_build, '@INPUT@', '@OUTPUT@'],
36                 install: get_option('build_doc'),
37                 install_dir: doc_install_dir)
38 endif