diff --git a/doc/meson.build b/doc/meson.build index d7d728a..39d6e8f 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -44,3 +44,19 @@ gnome.gtkdoc('calls', install: true) endif + +rst2man = find_program('rst2man', 'rst2man.py', required: false) +if get_option('manpages') and not rst2man.found() + error('No rst2man found, but man pages were explicitly enabled') +endif + +if get_option('manpages') and rst2man.found() + custom_target('man-gnome-calls', + input: 'gnome-calls.rst', + output: 'gnome-calls.1', + command: [rst2man, '@INPUT@'], + capture: true, + install: true, + install_dir: get_option('mandir') / 'man1', + ) +endif diff --git a/meson_options.txt b/meson_options.txt index 41f2046..141ed30 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,3 +5,7 @@ option('gtk_doc', option('tests', type: 'boolean', value: true, description: 'Whether to compile unit tests') + +option('manpages', + type: 'boolean', value: true, + description: 'Whether to generate man pages')