mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
run_command() was only run at configure time, meaning the generated version (that was passed on to the sources via -DFUZZEL_VERSION) became stale. Fix by implementing a shell script that generates a header file, and wrap this in a custom target that is run every time (but the generated file is only updated when the version changes)
20 lines
576 B
Meson
20 lines
576 B
Meson
sh = find_program('sh', native: true)
|
|
|
|
scdoc = dependency('scdoc', native: true)
|
|
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
|
|
|
foreach man_src : ['foot.1.scd', 'foot.5.scd']
|
|
parts = man_src.split('.')
|
|
name = parts[-3]
|
|
section = parts[-2]
|
|
out = '@0@.@1@'.format(name, section)
|
|
|
|
custom_target(
|
|
out,
|
|
output: out,
|
|
input: man_src,
|
|
command: [sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path())],
|
|
capture: true,
|
|
install: true,
|
|
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(section)))
|
|
endforeach
|