meson/docs/markdown/snippets/install_headers_preserve_pa...

36 lines
846 B
Markdown
Raw Normal View History

## Added preserve_path arg to install_headers
The [[install_headers]] function now has an optional argument `preserve_path`
that allows installing multi-directory headerfile structures that live
alongside sourcecode with a single command.
For example, the headerfile structure
```meson
headers = [
'one.h',
'two.h',
'alpha/one.h',
'alpha/two.h',
'alpha/three.h'
'beta/one.h'
]
```
can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)`
and the resulting directory tree will look like
```
{prefix}
└── include
   └── mylib
      ├── alpha
      │   ├── one.h
      │   ├── two.h
      │   └── three.h
      ├── beta
      │   └── one.h
      ├── one.h
      └── two.h
```