meson: provide a harfbuzz-config for use from CMake
See #822 and #1437.
This commit is contained in:
parent
6afa7e1c36
commit
535186fd84
16
meson.build
16
meson.build
|
@ -2,6 +2,22 @@ project('harfbuzz', 'c', 'cpp',
|
|||
meson_version: '>= 0.47.0',
|
||||
version: '2.2.0')
|
||||
|
||||
hb_version_arr = meson.project_version().split('.')
|
||||
hb_version_major = hb_version_arr[0].to_int()
|
||||
hb_version_minor = hb_version_arr[1].to_int()
|
||||
hb_version_micro = hb_version_arr[2].to_int()
|
||||
|
||||
# libtool versioning
|
||||
hb_version_int = hb_version_major*10000 + hb_version_minor*100 + hb_version_micro
|
||||
if hb_version_minor % 2 == 1
|
||||
hb_libtool_revision = 0 # for unstable releases
|
||||
else
|
||||
hb_libtool_revision = hb_version_micro # for stable releases
|
||||
endif
|
||||
hb_libtool_age = hb_version_int - hb_libtool_revision
|
||||
hb_libtool_current = hb_libtool_age
|
||||
hb_libtool_version_info = '@0@:@1@:@2@'.format(hb_libtool_current, hb_libtool_revision, hb_libtool_age)
|
||||
|
||||
pkgmod = import('pkgconfig')
|
||||
cpp = meson.get_compiler('cpp')
|
||||
|
||||
|
|
|
@ -254,7 +254,19 @@ pkgmod.generate(libharfbuzz_subset,
|
|||
version: meson.project_version(),
|
||||
)
|
||||
|
||||
if conf.get('HAVE_GOBJECT', 0) == 1
|
||||
have_gobject = conf.get('HAVE_GOBJECT', 0) == 1
|
||||
|
||||
cmake_config = configuration_data()
|
||||
cmake_config.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
|
||||
cmake_config.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
|
||||
cmake_config.set('HB_LIBTOOL_VERSION_INFO', hb_libtool_version_info)
|
||||
cmake_config.set('have_gobject', have_gobject ? 'true' : 'false')
|
||||
configure_file(input: 'harfbuzz-config.cmake.in',
|
||||
output: 'harfbuzz-config.cmake',
|
||||
configuration: cmake_config,
|
||||
install_dir: join_paths(get_option('libdir'), 'cmake', 'harfbuzz'))
|
||||
|
||||
if have_gobject
|
||||
gnome = import('gnome')
|
||||
|
||||
h_templ = configure_file(
|
||||
|
|
Loading…
Reference in New Issue