Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Enhance header installation #13

Closed
RobinMcCorkell opened this issue Oct 17, 2014 · 4 comments
Closed

Feature: Enhance header installation #13

RobinMcCorkell opened this issue Oct 17, 2014 · 4 comments

Comments

@RobinMcCorkell
Copy link
Contributor

One of the things about build systems that really annoys me is that one has to manually list every header file (with their full paths!) and specify their destination directory (with full paths!). It would be really useful to have some way of reducing the configuration required to cover 99.9% of cases, which is where the subdirectory containing the headers in the source mirrors how it should be installed.

One possible solution is to have an install_headers_dir option, which installs all headers matching a customizable pattern.

@jpakkane
Copy link
Member

Meson avoids globbing patterns due to the reasons outlined in the FAQ. However if you want to do this yourself, it is certainly possible.

First write a script that prints out the headers you want to install. Something like this:

#!/bin/sh
echo *.h

Then just use it like this:

install_headers(run_command('headerprinter.sh').stdout().strip().split(), subdir : 'subdir')

@jpakkane
Copy link
Member

Another alternative is that you can run a custom script during install time. If you just want to copy a big subtree from one place to another, just put a 'cp -r boo bar' there and you are done. See the manual page on installation for further instructions.

@RobinMcCorkell
Copy link
Contributor Author

I guess that makes sense. What about some way of respecting the paths to the files in install_headers()? So if I say install_headers('project/foo.h', nobase: true) then foo.h is installed as [includedir]/project/foo.h. GNU Automake supports this quite well: http://www.gnu.org/software/automake/manual/html_node/Alternative.html

@RobinMcCorkell
Copy link
Contributor Author

Superceded by #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants