Add scdoc to meson build process
This commit is contained in:
parent
798fe1a622
commit
2e037df045
31
meson.build
31
meson.build
|
@ -72,7 +72,7 @@ src_files = files(
|
|||
'src/modules/clock.cpp',
|
||||
'src/modules/custom.cpp',
|
||||
'src/modules/cpu.cpp',
|
||||
'src/modules/idle_inhibitor.cpp',
|
||||
'src/modules/idle_inhibitor.cpp',
|
||||
'src/modules/temperature.cpp',
|
||||
'src/main.cpp',
|
||||
'src/bar.cpp',
|
||||
|
@ -153,6 +153,35 @@ install_data(
|
|||
install_dir: join_paths(get_option('out'), 'etc/xdg/waybar')
|
||||
)
|
||||
|
||||
scdoc = dependency('scdoc', version: '>=1.9.2', native: true)
|
||||
|
||||
if scdoc.found()
|
||||
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
||||
sh = find_program('sh', native: true)
|
||||
mandir = get_option('mandir')
|
||||
man_files = [
|
||||
'waybar.5.scd',
|
||||
|
||||
]
|
||||
|
||||
foreach filename : man_files
|
||||
topic = filename.split('.')[-3].split('/')[-1]
|
||||
section = filename.split('.')[-2]
|
||||
output = '@0@.@1@'.format(topic, section)
|
||||
|
||||
custom_target(
|
||||
output,
|
||||
input: filename,
|
||||
output: output,
|
||||
command: [
|
||||
sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
|
||||
],
|
||||
install: true,
|
||||
install_dir: '@0@/man@1@'.format(mandir, section)
|
||||
)
|
||||
endforeach
|
||||
endif
|
||||
|
||||
clangtidy = find_program('clang-tidy', required: false)
|
||||
|
||||
if clangtidy.found()
|
||||
|
|
Loading…
Reference in New Issue