-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmeson.build
More file actions
105 lines (89 loc) · 3.25 KB
/
meson.build
File metadata and controls
105 lines (89 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
project(
'cz-kay',
'c','cpp',
version : '0.1.0',
meson_version: '>= 0.62.0',
default_options: [
'warning_level=2',
'buildtype=release',
'cpp_std=c++20'])
NAME='Kay'
VERSION_MAJOR = meson.project_version().split('.')[0]
VERSION_MINOR = meson.project_version().split('.')[1]
VERSION_PATCH = meson.project_version().split('.')[2]
VERSION_BUILD = run_command('cat', './BUILD', check : false).stdout()
HEADERS_INSTALL_DIR = join_paths(get_option('prefix'), get_option('includedir'))
FONTS_INSTALL_DIR = join_paths('/usr/share/fonts/cuarzo')
ASSETS_INSTALL_DIR = join_paths(get_option('prefix'), get_option('datadir'), 'Kay/Assets')
CONF_FILE_NAME = 'CZ' + NAME + 'Version.h'
conf = configuration_data()
conf.set('VERSION_MAJOR', VERSION_MAJOR)
conf.set('VERSION_MINOR', VERSION_MINOR)
conf.set('VERSION_PATCH', VERSION_PATCH)
conf_file = configure_file(
input : 'src/CZ/AK/' + CONF_FILE_NAME +'.in',
output : CONF_FILE_NAME,
configuration : conf)
install_data(
conf_file,
install_dir: HEADERS_INSTALL_DIR)
add_project_arguments([
'-DCZ_KAY_ASSETS_DIR="@0@"'.format(ASSETS_INSTALL_DIR),
'-DCZ_KAY_FONTS_DIR="@0@"'.format(FONTS_INSTALL_DIR)
], language: 'cpp')
# -------------- DEPENDENCIES --------------
cpp = meson.get_compiler('cpp')
pkg = import('pkgconfig')
cz_core_dep = dependency('cz-core')
cz_skia_dep = dependency('cz-skia')
cz_ream_dep = dependency('cz-ream')
xkbcommon_dep = dependency('xkbcommon')
yoga_dep = dependency('yoga', modules: ['yoga::yogacore'])
deps = [
cz_core_dep,
cz_skia_dep,
cz_ream_dep,
yoga_dep,
xkbcommon_dep
]
# -------------- SOURCES --------------
sources = run_command('find', './src/CZ/AK', '-type', 'f', '-name', '*[.cpp,.c,.h,.hpp,.cc]', check : false).stdout().strip().split('\n')
header_dirs = [
['./src/CZ/AK', 'CZ/AK'],
['./src/CZ/AK/Nodes', 'CZ/AK/Nodes'],
['./src/CZ/AK/Effects', 'CZ/AK/Effects'],
['./src/CZ/AK/Events', 'CZ/AK/Events'],
['./src/CZ/AK/Input', 'CZ/AK/Input']
]
foreach header_dir : header_dirs
header_files = run_command('find', header_dir[0], '-type', 'f', '-name', '*.h', '-maxdepth', '1', check : false).stdout().strip().split('\n')
install_headers(header_files, install_dir : join_paths(HEADERS_INSTALL_DIR, header_dir[1]))
endforeach
# -------------- LIBRARY --------------
cz_kay = library(
'cz-kay',
sources : sources,
include_directories : ['src'],
dependencies : deps,
soversion: VERSION_MAJOR,
install : true)
cz_kay_dep = declare_dependency(
dependencies: deps,
include_directories : ['src', 'src/CZ'],
link_with : cz_kay)
install_data(
run_command('find', './assets', '-type', 'f', '-name', '*[.png,.jpg]', check : false).stdout().strip().split('\n'),
install_dir: ASSETS_INSTALL_DIR
)
install_data(
run_command('find', './assets/fonts', '-type', 'f', '-name', '*[.ttf,.otf,.codepoints]', check : false).stdout().strip().split('\n'),
install_dir: FONTS_INSTALL_DIR
)
pkg.generate(
cz_kay,
name: 'cz-kay',
description: 'C++ GUI toolkit powered by Skia and Yoga.',
version: meson.project_version(),
filebase: 'cz-kay',
subdirs: ['CZ', 'CZ/AK', 'CZ/AK/Nodes', 'CZ/AK/Events', 'CZ/AK/Effects', 'CZ/AK/Input'],
libraries: deps)