2021-05-20 19:03:35 +00:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
|
|
|
|
project(
|
|
|
|
tomlplusplus
|
2021-10-23 09:22:41 +00:00
|
|
|
VERSION 2.6.0
|
2021-05-20 19:03:35 +00:00
|
|
|
DESCRIPTION "Header-only TOML config file parser and serializer for C++17 (and later!)"
|
|
|
|
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()
|