]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: doc - build doxyxml and html
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 30 Jan 2019 16:42:21 +0000 (17:42 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:41:53 +0000 (10:41 +0100)
doc/meson.build [new file with mode: 0644]
meson.build
meson_options.txt
scripts/doc-doxyxml.sh [new file with mode: 0755]

diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644 (file)
index 0000000..c75bd48
--- /dev/null
@@ -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
index 2b5536d704611242227adc156a03f4b2ad4e8d45..2d50ecd32a5621ee6b025ad38acdd16ca375fc6d 100644 (file)
@@ -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')
index 2d4c557ed74f63cb81e686db6e28259e0eca51f0..5f20ae8ad90643fc44f01b7fe2bcf72257412cdd 100644 (file)
@@ -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 (executable)
index 0000000..2975a60
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -o errexit -o nounset
+
+cd $1
+doxygen