| 1 |
project('install tag', 'c') |
| 2 |
|
| 3 |
subproject('subproject') |
| 4 |
|
| 5 |
subdir('subdir') |
| 6 |
|
| 7 |
# Those files should not be tagged |
| 8 |
configure_file(input: 'foo.in', output: 'foo-notag.h', |
| 9 |
configuration: {'foo': 'bar'}, |
| 10 |
install_dir: get_option('datadir'), |
| 11 |
install: true, |
| 12 |
) |
| 13 |
install_data('bar-notag.txt', |
| 14 |
install_dir: get_option('datadir') |
| 15 |
) |
| 16 |
custom_target('ct1', |
| 17 |
output: ['out1-notag.txt', 'out2-notag.txt'], |
| 18 |
command: ['script.py', '@OUTPUT@'], |
| 19 |
install_dir: get_option('datadir'), |
| 20 |
install: true, |
| 21 |
) |
| 22 |
|
| 23 |
# Those files should be tagged as devel |
| 24 |
install_headers('foo1-devel.h') |
| 25 |
install_data('bar-devel.h', |
| 26 |
install_dir: get_option('includedir'), |
| 27 |
) |
| 28 |
configure_file(input: 'foo.in', output: 'foo2-devel.h', |
| 29 |
configuration: {'foo': 'bar'}, |
| 30 |
install_dir: get_option('includedir'), |
| 31 |
install: true, |
| 32 |
) |
| 33 |
static_library('static', 'lib.c', |
| 34 |
install: true, |
| 35 |
) |
| 36 |
custom_target('ct-header1', |
| 37 |
output: ['ct-header1.h'], |
| 38 |
command: ['script.py', '@OUTPUT@'], |
| 39 |
install_dir: get_option('includedir'), |
| 40 |
install: true, |
| 41 |
) |
| 42 |
custom_target('ct-header2', |
| 43 |
output: ['ct-header2.h', 'ct-header3.h'], |
| 44 |
command: ['script.py', '@OUTPUT@'], |
| 45 |
install_dir: [false, get_option('includedir')], |
| 46 |
install: true, |
| 47 |
) |
| 48 |
install_emptydir(get_option('includedir') / 'subdir-devel') |
| 49 |
install_subdir('custom_files', |
| 50 |
install_dir: get_option('includedir'), |
| 51 |
) |
| 52 |
|
| 53 |
# Those files should have 'runtime' tag |
| 54 |
executable('app', 'main.c', |
| 55 |
install: true, |
| 56 |
) |
| 57 |
executable('app-otherdir', 'main.c', |
| 58 |
install: true, |
| 59 |
install_dir: 'otherbin', |
| 60 |
) |
| 61 |
shared_library('shared', 'lib.c', |
| 62 |
install: true, |
| 63 |
) |
| 64 |
both_libraries('both', 'lib.c', |
| 65 |
install: true, |
| 66 |
) |
| 67 |
|
| 68 |
# Unversioned .so file should have 'devel' tag, others should have 'runtime' tag |
| 69 |
shared_library('versioned_shared', 'lib.c', |
| 70 |
install: true, |
| 71 |
version: '1.2.3', |
| 72 |
) |
| 73 |
|
| 74 |
# Those files should have custom tag |
| 75 |
install_data('bar-custom.txt', |
| 76 |
install_dir: get_option('datadir'), |
| 77 |
install_tag: 'custom') |
| 78 |
configure_file(input: 'foo.in', output: 'foo-custom.h', |
| 79 |
configuration: {'foo': 'bar'}, |
| 80 |
install_dir: get_option('datadir'), |
| 81 |
install_tag: 'custom', |
| 82 |
install: true, |
| 83 |
) |
| 84 |
both_libraries('bothcustom', 'lib.c', |
| 85 |
install_tag: 'custom', |
| 86 |
install: true, |
| 87 |
) |
| 88 |
custom_target('ct2', |
| 89 |
output: ['out1-custom.txt', 'out2-custom.txt'], |
| 90 |
command: ['script.py', '@OUTPUT@'], |
| 91 |
install_dir: get_option('datadir'), |
| 92 |
install_tag: 'custom', |
| 93 |
install: true, |
| 94 |
) |
| 95 |
install_subdir('custom_files', |
| 96 |
install_dir: get_option('datadir'), |
| 97 |
install_tag: 'custom', |
| 98 |
) |
| 99 |
install_subdir('excludes', |
| 100 |
install_dir: get_option('datadir'), |
| 101 |
install_tag: 'custom', |
| 102 |
exclude_directories: 'excluded', |
| 103 |
exclude_files: 'excluded.txt', |
| 104 |
) |
| 105 |
|
| 106 |
# First is custom, 2nd is devel, 3rd has no tag |
| 107 |
custom_target('ct3', |
| 108 |
output: ['out3-custom.txt', 'out-devel.h', 'out3-notag.txt'], |
| 109 |
command: ['script.py', '@OUTPUT@'], |
| 110 |
install_dir: [get_option('datadir'), get_option('includedir'), get_option('datadir')], |
| 111 |
install_tag: ['custom', 'devel', false], |
| 112 |
install: true, |
| 113 |
) |
| 114 |
|
| 115 |
meson.add_install_script('script.py', install_tag: 'custom') |
| 116 |
meson.add_install_script('script.py') |