From 718e07f78a6f5a5a1c5c1a961308bd85afb4db30 Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Thu, 7 May 2020 12:38:21 +0200 Subject: build: build help.h with meson --- doc/meson.build | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'doc') 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 -- cgit v1.2.3-70-g09d2