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 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 Fixes #3371pull/7177/head
parent
37fea63033
commit
ad8f24f232
6 changed files with 78 additions and 7 deletions
@ -0,0 +1,3 @@ |
||||
/* This file goes, depending on the state of `preserve_path` into subdirectory of include root or into the `child` dir of the subdirectory of include root. */ |
||||
|
||||
int childdir_func(); |
@ -1,11 +1,12 @@ |
||||
project('header install') |
||||
|
||||
as_array = ['subdir.h'] |
||||
as_array = ['subdir.h', 'child/childdir.h'] |
||||
|
||||
subdir('vanishing_subdir') |
||||
subdir('sub') |
||||
|
||||
h1 = install_headers('rootdir.h') |
||||
h2 = install_headers(as_array, subdir : 'subdir') |
||||
h3 = install_headers(subheader) |
||||
h4 = install_headers(disabler()) |
||||
h3 = install_headers(as_array, subdir : 'subdir', preserve_path : true) |
||||
h4 = install_headers(subheader) |
||||
h5 = install_headers(disabler()) |
||||
|
Loading…
Reference in new issue