I have a resource folder that needs to be copied to the build directory in a project using Meson build. I was using a custom_target like this:
demo_res = custom_target('demo-res',
input: ['demo/res/materials.yml'],
output: ['res'],
command: ['cp', '-r', meson.source_root() + '/demo/res', './'],
install: false,
build_by_default: true
)
But, when testing a Windows build, it turns out the 'cp' command can't be called through a script in PowerShell and isn't available at all in cmd. I attempted to use 'copy', but for some reason this can not be called from meson as a command.
I'm aware of fs.copyfile, but that's only for single files and doesn't copy directories.
Is there some sort of cross-platform method, preferably internal to Meson, to copy a full directory full of multiple files to the build directory?