1#
2# Use, modification, and distribution are
3# subject to the Boost Software License, Version 1.0. (See accompanying
4# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5#
6# Copyright 2019 Rémi Gastaldi.
7# Copyright 2020-2021 René Ferdinand Rivera Morell.
8
9# This Meson file provides support for using the Lyra library externally as
10# a standalone project or by embedding in your Meson project tree. To use
11# externally you would need a 'dependency' declaration and to use the
12# project as a dependency where needed:
13#
14# ----
15# lyra_dep = dependency('lyra');
16#
17# executable('yourproject',
18#   ...
19#   dependencies : lyra_dep)
20# ----
21#
22# To use in your project tree you would only need to place the Lyra tree
23# in a subdirectory named 'subprojects' and add a dependency fallback
24#
25# ----
26# lyra_dep = dependency('lyra', fallback : ['Lyra', 'lyra_dep'])
27#
28# executable('yourproject',
29#   ...
30#   dependencies : lyra_dep)
31# ----
32
33project('Lyra','cpp',
34	version: '1.6',
35	default_options : ['cpp_std=c++11', 'cpp_eh=none', 'b_lto=true', 'warning_level=3'],
36	license: 'BSL-1.0')
37
38src = [
39	'include/lyra/arg.hpp',
40	'include/lyra/args.hpp',
41	'include/lyra/arguments.hpp',
42	'include/lyra/cli.hpp',
43	'include/lyra/cli_parser.hpp',
44	'include/lyra/command.hpp',
45	'include/lyra/detail/bound.hpp',
46	'include/lyra/detail/choices.hpp',
47	'include/lyra/detail/deprecated_parser_customization.hpp',
48	'include/lyra/detail/from_string.hpp',
49	'include/lyra/detail/invoke_lambda.hpp',
50	'include/lyra/detail/parse.hpp',
51	'include/lyra/detail/print.hpp',
52	'include/lyra/detail/result.hpp',
53	'include/lyra/detail/tokens.hpp',
54	'include/lyra/detail/trait_utils.hpp',
55	'include/lyra/detail/unary_lambda_traits.hpp',
56	'include/lyra/exe_name.hpp',
57	'include/lyra/group.hpp',
58	'include/lyra/help.hpp',
59	'include/lyra/literal.hpp',
60	'include/lyra/lyra.hpp',
61	'include/lyra/main.hpp',
62	'include/lyra/opt.hpp',
63	'include/lyra/option_style.hpp',
64	'include/lyra/parser.hpp',
65	'include/lyra/parser_result.hpp',
66	'include/lyra/val.hpp',
67	'include/lyra/version.hpp'
68]
69
70inc_dir = [include_directories('include')]
71
72lyra_lib = shared_library('lyra',
73	sources : src,
74	include_directories: inc_dir,
75	install: true,
76	install_dir : '/usr/lib')
77
78lyra_dep = declare_dependency(include_directories: inc_dir, link_with: lyra_lib)
79