2021-05-20 19:03:35 +00:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
|
|
|
|
project(
|
|
|
|
tomlplusplus
|
2022-01-13 10:09:07 +00:00
|
|
|
VERSION 3.0.1
|
2022-01-08 14:24:59 +00:00
|
|
|
DESCRIPTION "Header-only TOML config file parser and serializer for C++17"
|
2021-05-20 19:03:35 +00:00
|
|
|
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
|
|
|
|
LANGUAGES CXX
|
|
|
|
)
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
include(cmake/project-is-top-level.cmake)
|
|
|
|
include(cmake/variables.cmake)
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
# ---- Declare library ----
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
add_library(tomlplusplus_tomlplusplus INTERFACE)
|
|
|
|
add_library(tomlplusplus::tomlplusplus ALIAS tomlplusplus_tomlplusplus)
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
set_property(
|
|
|
|
TARGET tomlplusplus_tomlplusplus PROPERTY
|
|
|
|
EXPORT_NAME tomlplusplus
|
2021-02-02 16:45:59 +00:00
|
|
|
)
|
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
target_include_directories(
|
|
|
|
tomlplusplus_tomlplusplus
|
|
|
|
${tomlplusplus_warning_guard} # unquoted for list expansion
|
|
|
|
INTERFACE
|
|
|
|
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
|
|
|
|
)
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
target_compile_features(tomlplusplus_tomlplusplus INTERFACE cxx_std_17)
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
# ---- Install rules ----
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
include(cmake/install-rules.cmake)
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
# ---- Examples ----
|
2021-02-02 16:45:59 +00:00
|
|
|
|
2021-05-20 19:03:35 +00:00
|
|
|
if(PROJECT_IS_TOP_LEVEL)
|
|
|
|
option(BUILD_EXAMPLES "Build examples tree." OFF)
|
|
|
|
if(BUILD_EXAMPLES)
|
|
|
|
add_subdirectory(examples)
|
|
|
|
endif()
|
2021-02-02 16:45:59 +00:00
|
|
|
endif()
|