diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-11-30 11:34:44 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-11-30 11:39:11 -0500 |
commit | 03182706cffc4e996d352c51b143df805f80a928 (patch) | |
tree | bd24f696abd184029406b4d690cb6a1fdafa3f39 | |
parent | add meson install files (diff) | |
download | sway-03182706cffc4e996d352c51b143df805f80a928.tar.gz sway-03182706cffc4e996d352c51b143df805f80a928.tar.zst sway-03182706cffc4e996d352c51b143df805f80a928.zip |
meson build manpages
-rw-r--r-- | meson.build | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 494f2866..34122acc 100644 --- a/meson.build +++ b/meson.build | |||
@@ -29,6 +29,39 @@ pixman = dependency('pixman-1') | |||
29 | libcap = dependency('libcap') | 29 | libcap = dependency('libcap') |
30 | math = cc.find_library('m') | 30 | math = cc.find_library('m') |
31 | git = find_program('git', required: false) | 31 | git = find_program('git', required: false) |
32 | a2x = find_program('a2x', required: false) | ||
33 | |||
34 | if a2x.found() | ||
35 | mandir = get_option('mandir') | ||
36 | man_files = [ | ||
37 | 'sway/sway.1.txt', | ||
38 | 'sway/sway.5.txt', | ||
39 | 'sway/sway-bar.5.txt', | ||
40 | 'sway/sway-input.5.txt', | ||
41 | 'sway/sway-security.7.txt', | ||
42 | 'swaymsg/swaymsg.1.txt', | ||
43 | ] | ||
44 | foreach filename : man_files | ||
45 | topic = filename.split('.')[-3].split('/')[-1] | ||
46 | section = filename.split('.')[-2] | ||
47 | |||
48 | custom_target( | ||
49 | 'man-@0@-@1@'.format(topic, section), | ||
50 | input: filename, | ||
51 | output: '@BASENAME@', | ||
52 | command: [ | ||
53 | a2x, | ||
54 | '--no-xmllint', | ||
55 | '--doctype', 'manpage', | ||
56 | '--format', 'manpage', | ||
57 | '--destination-dir', meson.current_build_dir(), | ||
58 | '@INPUT@' | ||
59 | ], | ||
60 | install: true, | ||
61 | install_dir: '@0@/man@1@'.format(mandir, section) | ||
62 | ) | ||
63 | endforeach | ||
64 | endif | ||
32 | 65 | ||
33 | version = get_option('sway_version') | 66 | version = get_option('sway_version') |
34 | if version != '' | 67 | if version != '' |