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