diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/meson.build | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/doc/meson.build b/doc/meson.build index 6142884..f6d4878 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,8 +1,4 @@ -scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) -sh = find_program('sh', native: true) -mandir = get_option('mandir') - -man_files = [ +man_files = files( 'apk.8.scd', 'apk-add.8.scd', 'apk-audit.8.scd', @@ -25,22 +21,28 @@ man_files = [ 'apk-verify.8.scd', 'apk-version.8.scd', 'apk-world.5.scd', -] +) + +if scdoc_dep.found() + scdoc_prog = find_program(scdoc_dep.get_pkgconfig_variable('scdoc'), native: true) + sh = find_program('sh', native: true) + mandir = get_option('mandir') -foreach filename : man_files - topic = filename.split('.')[-3].split('/')[-1] - section = filename.split('.')[-2] - output = '@0@.@1@'.format(topic, section) + foreach filename : man_files + topic = '@0@'.format(filename).split('.')[-3].split('/')[-1] + section = '@0@'.format(filename).split('.')[-2] + output = '@0@.@1@'.format(topic, section) - custom_target( - output, - input: filename, - capture: true, - output: output, - command: [ - sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path()) - ], - install: true, - install_dir: '@0@/man@1@'.format(mandir, section) - ) -endforeach
\ No newline at end of file + custom_target( + output, + input: filename, + capture: true, + output: output, + command: [ + sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path()) + ], + install: true, + install_dir: '@0@/man@1@'.format(mandir, section) + ) + endforeach +endif |