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 = [
@@ -90,28 +90,14 @@ if get_option('with-docs')
install: true)
endif
if get_option('with-man')
custom_target('glib-gettextize-man',
input: 'glib-gettextize.xml',
output: 'glib-gettextize.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
custom_target('gtester-man',
input: 'gtester.xml',
output: 'gtester.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
custom_target('gtester-report-man',
input: 'gtester-report.xml',
output: 'gtester-report.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
if get_option('with-man') != 'no' and xsltproc.found()
manpages = ['glib-gettextize', 'gtester', 'gtester-report']
foreach page : manpages
custom_target(page + '-man',
input: page + '.xml',
output: page + '.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir)
endforeach
endif