| 1 |
project('custom install script', 'c') |
| 2 |
|
| 3 |
meson.add_install_script('myinstall.py', 'diiba/daaba', 'file.dat', dry_run: true) |
| 4 |
meson.add_install_script('myinstall.py', 'this/should', 'also-work.dat') |
| 5 |
|
| 6 |
subdir('src') |
| 7 |
|
| 8 |
meson.add_install_script('myinstall.py', 'dir', afile, '--mode=copy') |
| 9 |
|
| 10 |
data = configuration_data() |
| 11 |
data.set10('foo', true) |
| 12 |
conf = configure_file( |
| 13 |
configuration : data, |
| 14 |
output : 'conf.txt' |
| 15 |
) |
| 16 |
|
| 17 |
meson.add_install_script('myinstall.py', 'dir', conf, '--mode=copy') |
| 18 |
|
| 19 |
t = custom_target( |
| 20 |
'ct', |
| 21 |
command : [find_program('customtarget.py'), '@OUTDIR@'], |
| 22 |
output : ['1.txt', '2.txt'], |
| 23 |
) |
| 24 |
|
| 25 |
meson.add_install_script('myinstall.py', 'customtarget', t, '--mode=copy') |
| 26 |
meson.add_install_script('myinstall.py', 'customtargetindex', t[0], '--mode=copy') |
| 27 |
|
| 28 |
installer = configure_file( |
| 29 |
input : 'myinstall.py', |
| 30 |
output : 'myinstall_copy.py', |
| 31 |
copy : true, |
| 32 |
) |
| 33 |
|
| 34 |
meson.add_install_script(installer, 'otherdir', afile, '--mode=copy') |
| 35 |
|
| 36 |
# This executable links on a library built in src/ directory. On Windows this |
| 37 |
# means meson must add src/ into $PATH to find the DLL when running it as |
| 38 |
# install script. |
| 39 |
myexe = executable('prog', 'prog.c', |
| 40 |
link_with: mylib, |
| 41 |
install : true, |
| 42 |
) |
| 43 |
if meson.can_run_host_binaries() |
| 44 |
meson.add_install_script(myexe) |
| 45 |
endif |