mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-10-06 06:49:43 +00:00
Add the Cmake configuration files support (#22) [skip ci]
This commit is contained in:
parent
dce20a7e2d
commit
ee35432b71
14
cmake/tomlplusplus.cmake.in
Normal file
14
cmake/tomlplusplus.cmake.in
Normal file
@ -0,0 +1,14 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
# If tomlplusplus::tomlplusplus target is not defined it will be included
|
||||
if(NOT TARGET tomlplusplus::tomlplusplus)
|
||||
|
||||
# Import tomlplusplus interface library
|
||||
add_library(tomlplusplus::tomlplusplus INTERFACE IMPORTED)
|
||||
set_target_properties(tomlplusplus::tomlplusplus PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include")
|
||||
|
||||
# Require C++17
|
||||
target_compile_features(tomlplusplus::tomlplusplus INTERFACE cxx_std_17)
|
||||
|
||||
endif()
|
13
meson.build
13
meson.build
@ -17,6 +17,7 @@ tomlplusplus_dep = declare_dependency(
|
||||
version : meson.project_version(),
|
||||
)
|
||||
|
||||
|
||||
build_tests = false
|
||||
if get_option('BUILD_TESTS').auto()
|
||||
build_tests = (not meson.is_subproject())
|
||||
@ -109,3 +110,15 @@ pkgc.generate (
|
||||
version: meson.project_version(),
|
||||
description: 'Header-only TOML config file parser and serializer for modern C++'
|
||||
)
|
||||
|
||||
cmake = import('cmake')
|
||||
cmake.write_basic_package_version_file(
|
||||
name: 'tomlplusplus',
|
||||
version: meson.project_version())
|
||||
|
||||
conf = configuration_data()
|
||||
cmake.configure_package_config_file(
|
||||
name: 'tomlplusplus',
|
||||
input: 'cmake/tomlplusplus.cmake.in',
|
||||
configuration: conf,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user