OSDN Git Service

build: meson: build documentation
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 19 Jan 2018 19:42:11 +0000 (20:42 +0100)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 1 Feb 2018 01:24:11 +0000 (09:24 +0800)
doc/meson.build [new file with mode: 0644]
meson.build
meson_options.txt

diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644 (file)
index 0000000..3c1b8f9
--- /dev/null
@@ -0,0 +1,49 @@
+ headerdir = join_paths(meson.source_root(), 'va')
+footer = join_paths(meson.current_source_dir(), 'va_footer.html')
+
+libva_headers_doc = [
+  'va.h',
+  'va_enc_h264.h',
+  'va_enc_mpeg2.h',
+  'va_enc_jpeg.h',
+  'va_enc_hevc.h',
+  'va_enc_vp8.h',
+  'va_enc_vp9.h',
+  'va_fei.h',
+  'va_fei_h264.h',
+  'va_fei_hevc.h',
+  'va_dec_hevc.h',
+  'va_dec_jpeg.h',
+  'va_dec_vp8.h',
+  'va_dec_vp9.h',
+  'va_vpp.h'
+]
+
+libva_doc_files = []
+headers = ''
+foreach h : libva_headers_doc
+  libva_doc_files += join_paths (headerdir, h)
+  headers += ' ' + join_paths (headerdir, h)
+endforeach
+
+config = configuration_data()
+config.set('PACKAGE_VERSION', meson.project_version())
+config.set('VA_HEADER_DIR', headerdir)
+config.set('VA_HEADER_FILES', headers)
+config.set('VA_HTML_FOOTER', footer)
+config.set('OUTDIR', meson.current_build_dir())
+
+doxyfile = configure_file(
+  input: 'Doxyfile.in',
+  output: 'Doxyfile',
+  configuration: config)
+
+doc_install_dir = join_paths(get_option('datadir'), 'doc', meson.project_name())
+custom_target(
+  'doc',
+  command: [ doxygen, doxyfile ],
+  depend_files: libva_doc_files,
+  input: doxyfile,
+  output: 'html-out',
+  install: true,
+  install_dir: doc_install_dir)
index f7ae4cd..d24a597 100644 (file)
@@ -115,3 +115,9 @@ endif
 
 subdir('va')
 subdir('pkgconfig')
+
+doxygen = find_program('doxygen', required: false)
+
+if get_option('enable_docs') and doxygen.found()
+  subdir('doc')
+endif
index 3b9a68a..0f7261a 100644 (file)
@@ -3,3 +3,4 @@ option('disable_drm', type : 'boolean', value : false)
 option('with_x11', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
 option('with_glx', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
 option('with_wayland', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
+option('enable_docs', type : 'boolean', value : false)