Skip to content

Commit 1467a3e

Browse files
authored
Merge pull request #99 from neheb/conf
meson: add cmake variable handling
2 parents e67bdb5 + 4200caa commit 1467a3e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: meson.build

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@ else
1818
endif
1919
libarchive_dep = dependency('libarchive')
2020

21+
vers = meson.project_version().split('.')
22+
cdata = configuration_data()
23+
cdata.set('PROJECT_VERSION', meson.project_version())
24+
cdata.set('PROJECT_VERSION_MAJOR', vers[0])
25+
cdata.set('PROJECT_VERSION_MINOR', vers[1])
26+
cdata.set('PROJECT_VERSION_PATCH', vers[2])
27+
cdata.set('QARCHIVE_STATIC', get_option('default_library') == 'static')
28+
2129
conf = configure_file(
2230
format: 'cmake@',
2331
input: 'other/cmake/config.h.in',
2432
output: 'config.h',
25-
configuration: configuration_data({'QARCHIVE_STATIC': get_option('default_library') == 'static'}),
33+
configuration: cdata,
2634
)
2735

2836
src = files(

0 commit comments

Comments
 (0)