80c21d1682ae8232129ed46ec21a2b49a8b4d76d
[dpdk.git] / doc / guides / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3
4 sphinx = find_program('sphinx-build', required: get_option('enable_docs'))
5
6 if not sphinx.found()
7         subdir_done()
8 endif
9
10 htmldir = join_paths('share', 'doc', 'dpdk')
11 html_guides = custom_target('html_guides',
12         input: meson.current_source_dir(),
13         output: 'guides',
14         command: [sphinx, '-b', 'html',
15                 '-d', meson.current_build_dir() + '/.doctrees',
16                 '@INPUT@', meson.current_build_dir() + '/guides'],
17         build_by_default: get_option('enable_docs'),
18         install: get_option('enable_docs'),
19         install_dir: htmldir)
20
21 doc_targets += html_guides
22 doc_target_names += 'HTML_Guides'
23
24 # sphinx leaves a .buildinfo in the target directory, which we don't
25 # want to install. Note that sh -c has to be used, otherwise the
26 # env var does not get expanded if calling rm/install directly.
27 meson.add_install_script('sh', '-c',
28         'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo')
29 meson.add_install_script('sh', '-c',
30         'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css')