1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
project('vcstag', 'c')
version_src = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag.c',
fallback : '1.0.0')
version_src_custom = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag-custom.c',
command : ['git', 'show-ref', '-s', 'refs/heads/master'],
fallback : '1.0.0')
version_src_notfound_fallback = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag-notfound-fallback.c',
command : ['git-but-not-found-sorry', 'show-ref', '-s', 'refs/heads/master'],
fallback : '1.0.0')
version_src_fallback = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag-fallback.c')
git = find_program('git')
version_src_git_program = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag-git-program.c',
command : [git, 'rev-parse', 'HEAD'],
fallback : '1.0.0')
version_src_file = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag-file.c',
command : files('version.py'))
tagprog = executable('tagprog', 'tagprog.c', version_src)
version_src_executable = vcs_tag(input : 'vcstag.c.in',
output : 'vcstag-executable.c',
command : [tagprog],
install: true,
install_dir: get_option('includedir'))
executable('tagprog-custom', 'tagprog.c', version_src_custom)
executable('tagprog-fallback', 'tagprog.c', version_src_fallback)
executable('tagprog-notfound-fallback', 'tagprog.c', version_src_notfound_fallback)
executable('tagprog-git-program', 'tagprog.c', version_src_git_program)
executable('tagprog-executable', 'tagprog.c', version_src_executable)
executable('tagprog-file', 'tagprog.c', version_src_file)
|