Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: install header and pkg-config file and in subprojects #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions include/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@

include_dir = include_directories('.')

if not is_subproject
install_subdir('toml++', install_dir: get_option('includedir'))
endif
install_subdir('toml++', install_dir: get_option('includedir'))

if not build_lib # header-only mode

tomlplusplus_dep = declare_dependency(include_directories: include_dir)

if not is_subproject
import('pkgconfig').generate(
name: meson.project_name(),
description: 'Header-only TOML config file parser and serializer for C++',
install_dir: get_option('datadir')/'pkgconfig',
url: 'https://marzer.github.io/tomlplusplus'
)
endif
import('pkgconfig').generate(
name: meson.project_name(),
description: 'Header-only TOML config file parser and serializer for C++',
install_dir: get_option('datadir')/'pkgconfig',
url: 'https://marzer.github.io/tomlplusplus'
)

# cmake
if get_option('generate_cmake_config') and not is_subproject and not is_devel
Expand Down
16 changes: 7 additions & 9 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tomlplusplus_lib = library(
cpp_args: lib_internal_args,
gnu_symbol_visibility: get_option('default_library') == 'static' ? '' : 'hidden',
include_directories: include_dir,
install: not is_subproject,
install: true,
version: meson.project_version(),
override_options: global_overrides
)
Expand All @@ -43,14 +43,12 @@ tomlplusplus_dep = declare_dependency(
link_with: tomlplusplus_lib
)

if not is_subproject
import('pkgconfig').generate(
tomlplusplus_lib,
description: 'TOML config file parser and serializer for C++',
extra_cflags: lib_args,
url: 'https://marzer.github.io/tomlplusplus'
)
endif
import('pkgconfig').generate(
tomlplusplus_lib,
description: 'TOML config file parser and serializer for C++',
extra_cflags: lib_args,
url: 'https://marzer.github.io/tomlplusplus'
)

# cmake
if get_option('generate_cmake_config') and not is_subproject and not is_devel
Expand Down