raw/ifpga/base: add PMCI sensor driver
[dpdk.git] / doc / api / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
3
4 doxygen = find_program('doxygen', required: get_option('enable_docs'))
5
6 if not doxygen.found()
7   subdir_done()
8 endif
9
10 # due to the CSS customisation script, which needs to run on a file that
11 # is in a subdirectory that is created at build time and thus it cannot
12 # be an individual custom_target, we need to wrap the doxygen call in a
13 # script to run the CSS modification afterwards
14 generate_doxygen = py3 + files('generate_doxygen.py')
15 generate_examples = py3 + files('generate_examples.py')
16
17 htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk')
18
19 # due to the following bug: https://github.com/mesonbuild/meson/issues/4107
20 # if install is set to true it will override build_by_default and it will
21 # cause the target to always be built. If install were to be always set to
22 # false it would be impossible to install the docs.
23 # So use a configure option for now.
24 example = custom_target('examples.dox',
25         output: 'examples.dox',
26         command: [generate_examples, join_paths(dpdk_source_root, 'examples'), '@OUTPUT@'],
27         depfile: 'examples.dox.d',
28         install: get_option('enable_docs'),
29         install_dir: htmldir,
30         build_by_default: get_option('enable_docs'))
31
32 cdata = configuration_data()
33 cdata.set('VERSION', meson.project_version())
34 cdata.set('API_EXAMPLES', join_paths(dpdk_build_root, 'doc', 'api', 'examples.dox'))
35 cdata.set('OUTPUT', join_paths(dpdk_build_root, 'doc', 'api'))
36 cdata.set('HTML_OUTPUT', 'html')
37 cdata.set('TOPDIR', dpdk_source_root)
38 cdata.set('STRIP_FROM_PATH', ' '.join([dpdk_source_root, join_paths(dpdk_build_root, 'doc', 'api')]))
39 cdata.set('WARN_AS_ERROR', 'NO')
40 if get_option('werror')
41     cdata.set('WARN_AS_ERROR', 'YES')
42 endif
43
44 doxy_conf = configure_file(input: 'doxy-api.conf.in',
45         output: 'doxy-api.conf',
46         configuration: cdata)
47
48 doxy_build = custom_target('doxygen',
49         depends: example,
50         depend_files: 'doxy-api-index.md',
51         input: doxy_conf,
52         output: 'html',
53         depfile: 'html.d',
54         command: [generate_doxygen, '@OUTPUT@', doxygen, '@INPUT@'],
55         install: get_option('enable_docs'),
56         install_dir: htmldir,
57         build_by_default: get_option('enable_docs'))
58
59 doc_targets += doxy_build
60 doc_target_names += 'Doxygen_API'