build(meson): do not install if used as subproj (#114)

This commit is contained in:
Andrea Pappacoda 2021-09-21 15:57:05 +02:00 committed by GitHub
parent 9aa7cd8218
commit 6bfdc14b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -496,10 +496,12 @@ if build_examples
subdir('examples')
endif
install_subdir('include/toml++',
strip_directory: true,
install_dir: 'include/toml++'
)
if not is_subproject
install_subdir('include/toml++',
strip_directory: true,
install_dir: 'include/toml++'
)
endif
#######################################################################################################################
# dependencies, cmake etc.
@ -510,13 +512,14 @@ tomlplusplus_dep = declare_dependency(
version : meson.project_version(),
)
pkgc = import('pkgconfig')
pkgc.generate(
name: meson.project_name(),
version: meson.project_version(),
description: 'Header-only TOML config file parser and serializer for C++',
install_dir: join_paths(get_option('datadir'), 'pkgconfig'),
)
if not is_subproject
import('pkgconfig').generate(
name: meson.project_name(),
version: meson.project_version(),
description: 'Header-only TOML config file parser and serializer for C++',
install_dir: join_paths(get_option('datadir'), 'pkgconfig'),
)
endif
# cmake
if get_option('generate_cmake_config') and not is_subproject