From ffa52fdbc18d3211e8706cc7f7e6b629d72e84ad Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Fri, 24 Nov 2023 17:48:22 +0200 Subject: [PATCH] meson.build: separate options for installing man pages or docs --- doc/meson.build | 4 ++-- meson.build | 20 +++++++++++++------- meson_options.txt | 6 +++++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index 2deb4039f..3edaeb9f1 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -209,7 +209,7 @@ html_target = custom_target('pipewire-docs', output: [ 'html' ], command: [ doxygen, doxyfile ], env: doxygen_env, - install: true, + install: install_docs, install_tag: 'doc', install_dir: docdir) @@ -230,7 +230,7 @@ foreach m : manpages input : html_target, depend_files : [ man_fixup ], capture : true, - install : true, + install : install_man, install_tag: 'man', install_dir : get_option('mandir') / 'man' + section ) diff --git a/meson.build b/meson.build index 6bf25eef5..8f75a7058 100644 --- a/meson.build +++ b/meson.build @@ -485,18 +485,24 @@ if alsa_dep.found() subdir('pipewire-alsa/tests') endif -doxygen = find_program('doxygen', required : get_option('docs')) -pymod = import('python') -python = pymod.find_installation('python3', required: get_option('docs')) -generate_docs = doxygen.found() and python.found() +generate_docs = get_option('man').enabled() or get_option('docs').enabled() +if get_option('man').allowed() or get_option('docs').allowed() + doxygen = find_program('doxygen', required : generate_docs) + pymod = import('python') + python = pymod.find_installation('python3', required: generate_docs) + generate_docs = doxygen.found() and python.found() +endif + +install_docs = get_option('docs').require(generate_docs).allowed() +install_man = get_option('man').require(generate_docs).allowed() + +summary({'Documentation ': install_docs}, bool_yn: true) +summary({'Man pages ': install_man}, bool_yn: true) if generate_docs subdir('doc') endif -summary({'Documentation and man pages ': generate_docs}, bool_yn: true) - - setenv = find_program('pw-uninstalled.sh') run_target('pw-uninstalled', command : [setenv, diff --git a/meson_options.txt b/meson_options.txt index 713e253f7..a09b65859 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,7 +2,11 @@ option('docdir', type : 'string', description : 'Directory for installing documentation to (defaults to pipewire_datadir/doc/meson.project_name() )') option('docs', - description: 'Build documentation', + description: 'Documentation', + type: 'feature', + value: 'disabled') +option('man', + description: 'Manual pages', type: 'feature', value: 'disabled') option('examples',