Add support for being used as a meson subproject #237

Merged
dcbaker merged 2 commits from submit/meson-subproject-support into master 2021-12-01 15:17:07 +00:00
1 changed files with 13 additions and 1 deletions

View File

@ -72,6 +72,18 @@ libpkgconf = library('pkgconf',
soversion : '3',
)
# For other projects using libpkgconfig as a subproject
dep_libpkgconf = declare_dependency(
link_with : libpkgconf,
include_directories : include_directories('.'),
)
# If we have a new enough meson override the dependency so that only
# `dependency('libpkgconf')` is required from the consumer
if meson.version().version_compare('>= 0.54.0')
meson.override_dependency('libpkgconf', dep_libpkgconf)
endif
pkg = import('pkgconfig')
pkg.generate(libpkgconf,
name : 'libpkgconf',
@ -107,4 +119,4 @@ install_man('man/pc.5')
install_man('man/pkgconf-personality.5')
install_data('pkg.m4', install_dir: 'share/aclocal')
install_data('AUTHORS', install_dir: 'share/doc/pkgconf')
install_data('README.md', install_dir: 'share/doc/pkgconf')
install_data('README.md', install_dir: 'share/doc/pkgconf')