diff --git a/meson.build b/meson.build index cb3330d..b733b09 100644 --- a/meson.build +++ b/meson.build @@ -89,33 +89,34 @@ if get_option('fish-completions') endif # Man pages -man_pages = get_option('man-pages') -scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: man_pages) -if scdoc.found() - scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) +if get_option('man-pages') + scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: true) + if scdoc.found() + scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) - mandir = get_option('mandir') - man_files = [ - 'swaync.1.scd', - 'swaync.5.scd', - 'swaync-client.1.scd', - ] + mandir = get_option('mandir') + man_files = [ + 'swaync.1.scd', + 'swaync.5.scd', + 'swaync-client.1.scd', + ] - foreach filename : man_files - topic = filename.split('.')[-3].split('/')[-1] - section = filename.split('.')[-2] - output = '@0@.@1@'.format(topic, section) - message(mandir, section, '@0@/man@1@'.format(mandir, section)) + foreach filename : man_files + topic = filename.split('.')[-3].split('/')[-1] + section = filename.split('.')[-2] + output = '@0@.@1@'.format(topic, section) + message(mandir, section, '@0@/man@1@'.format(mandir, section)) - custom_target( - output, - input: join_paths('man', filename), - output: output, - command: scdoc_prog, - install: true, - feed: true, - capture: true, - install_dir: '@0@/man@1@'.format(mandir, section) - ) - endforeach + custom_target( + output, + input: join_paths('man', filename), + output: output, + command: scdoc_prog, + install: true, + feed: true, + capture: true, + install_dir: '@0@/man@1@'.format(mandir, section) + ) + endforeach + endif endif