diff --git a/doc/meson.build b/doc/meson.build index 24a586bb4..9f66e4383 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -36,3 +36,22 @@ if get_option('manpages') install_dir: [join_paths(get_option('mandir'), 'man1'), join_paths(get_option('mandir'), 'man5')], ) endif + +doxygen = find_program('doxygen', required: false) +if get_option('doxygen') and doxygen.found() + + conf_data = configuration_data() + conf_data.set('VERSION', meson.project_version()) + conf_data.set('abs_top_srcdir', meson.source_root()) + doxyfile = configure_file( + input: 'doxygen.conf.in', + output: 'Doxyfile', + configuration: conf_data + ) + + custom_target('Doxygen', + command: [doxygen, doxyfile], + output: ['api'], + build_by_default: true + ) +endif diff --git a/meson_options.txt b/meson_options.txt index 523821bf2..0bed82234 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,7 @@ option('documentation', type: 'feature', description: 'Build documentation') option('html_manual', type: 'boolean', value: true, description: 'Build the HTML manual') option('manpages', type: 'boolean', value: true, description: 'Build manual pages') +option('doxygen', type: 'boolean', value: false, description: 'Build doxygen source documentation') option('syslog', type: 'feature', description: 'syslog support') option('inotify', type: 'boolean', value: true, description: 'inotify support (for automatic database update)')