meson: Detect with-docs and with-man automatically

By default, only build man pages and gtk-doc if the build-deps were
found. To force-enable, pass -Dwith-docs=yes and -Dwith-man=yes.

Also use a foreach loop for man pages instead of listing them all
manually
This commit is contained in:
Nirbheek Chauhan
2017-03-21 16:38:47 +05:30
committed by Matthias Clasen
parent 5549a1d0c3
commit 88e437873a
5 changed files with 42 additions and 131 deletions

View File

@@ -1,4 +1,4 @@
if get_option('with-docs')
if get_option('with-docs') != 'no'
subdir('xml')
ignore_headers = [
@@ -51,28 +51,14 @@ if get_option('with-docs')
)
endif
if get_option('with-man')
custom_target('glib-mkenums-man',
input: 'glib-mkenums.xml',
output: 'glib-mkenums.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
custom_target('glib-genmarshal-man',
input: 'glib-genmarshal.xml',
output: 'glib-genmarshal.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
custom_target('gobject-query-man',
input: 'gobject-query.xml',
output: 'gobject-query.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
if get_option('with-man') != 'no' and xsltproc.found()
manpages = ['glib-mkenums', 'glib-genmarshal', 'gobject-query']
foreach page : manpages
custom_target(page + '-man',
input: page + '.xml',
output: page + '.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir)
endforeach
endif