From: Tomas Krizek Date: Wed, 30 Jan 2019 16:42:21 +0000 (+0100) Subject: meson: doc - build doxyxml and html X-Git-Tag: v4.0.0~24^2~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca8a82e51b7fddb527fe8a38310e1f5d0ced75f9;p=thirdparty%2Fknot-resolver.git meson: doc - build doxyxml and html --- diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 000000000..c75bd4830 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,40 @@ +if get_option('doc') + # doc dependencies + doxygen = find_program('doxygen') + sphinx_build = find_program('sphinx-build') + # python-breathe is also required, but not auto detected because python 2/3 + + # create doxygen in source dir + doc_doxyxml = custom_target( + 'doxyxml doc', + command: [ + '../scripts/doc-doxyxml.sh', + meson.current_source_dir(), + ], + output: 'doxygen', + build_always_stale: true, + build_by_default: true, + ) + + # create html docs in build dir + doc = custom_target( + 'html doc', + command: [ + sphinx_build, + '-W', + '-b', 'html', + meson.current_source_dir(), + '@OUTPUT@', + ], + output: 'html', + build_always_stale: true, + build_by_default: true, + depends: doc_doxyxml, + ) + + # install html docs + install_subdir( + join_paths(meson.current_build_dir(), 'html'), + install_dir: doc_dir, + ) +endif diff --git a/meson.build b/meson.build index 2b5536d70..2d50ecd32 100644 --- a/meson.build +++ b/meson.build @@ -21,15 +21,6 @@ luajit = dependency('luajit') # Optional dependencies -## documentation -doxygen = find_program('doxygen', required: false) -sphinx_build = find_program('sphinx-build', required: false) -python_breathe = run_command( - 'python3', ['-c', 'import breathe']).returncode() == 0 -if not python_breathe - warning('python: breathe not found') -endif - ## tests cmocka = dependency('cmocka', required: false) socket_wrapper = dependency('socket_wrapper', required: false) @@ -84,6 +75,7 @@ subdir('daemon') subdir('modules') -# install data +# documentation, install, tests # TODO install man +subdir('doc') subdir('etc') diff --git a/meson_options.txt b/meson_options.txt index 2d4c557ed..5f20ae8ad 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,5 @@ option('client', type : 'boolean', value : true, description: 'kresc client binary') option('daemon', type: 'boolean', value: true, description: 'kresd daemon binary') +option('doc', type: 'boolean', value: false, description: 'html documentation') option('modules_dir', type: 'string', description: 'path to kres modules directory') option('keyfile_default', type: 'string', description: 'path to trust anchors file') diff --git a/scripts/doc-doxyxml.sh b/scripts/doc-doxyxml.sh new file mode 100755 index 000000000..2975a600c --- /dev/null +++ b/scripts/doc-doxyxml.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -o errexit -o nounset + +cd $1 +doxygen