From b2a93eb26751fa7075c1255956b5b2f9f674e50e Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 27 Jun 2024 00:28:40 +0900 Subject: [PATCH 1/4] chore: auto extract version string in cmake --- CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e56233..dcfc83a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,18 @@ cmake_minimum_required(VERSION 3.16) -project(toml11 LANGUAGES CXX VERSION 4.0.0) + +# project_source_dir has not been set yet +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/toml11/version.hpp" TOML11_MAJOR_VERSION_STRING + REGEX "#define TOML11_VERSION_MAJOR ([0-9]+)") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/toml11/version.hpp" TOML11_MINOR_VERSION_STRING + REGEX "#define TOML11_VERSION_MINOR ([0-9]+)") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/toml11/version.hpp" TOML11_PATCH_VERSION_STRING + REGEX "#define TOML11_VERSION_PATCH ([0-9]+)") + +string(REGEX REPLACE "#define TOML11_VERSION_MAJOR ([0-9]+)" "\\1" TOML11_VERSION_MAJOR "${TOML11_MAJOR_VERSION_STRING}") +string(REGEX REPLACE "#define TOML11_VERSION_MINOR ([0-9]+)" "\\1" TOML11_VERSION_MINOR "${TOML11_MINOR_VERSION_STRING}") +string(REGEX REPLACE "#define TOML11_VERSION_PATCH ([0-9]+)" "\\1" TOML11_VERSION_PATCH "${TOML11_PATCH_VERSION_STRING}") + +project(toml11 LANGUAGES CXX VERSION "${TOML11_VERSION_MAJOR}.${TOML11_VERSION_MINOR}.${TOML11_VERSION_PATCH}") include(CMakeDependentOption) include(CTest) From 932acba7f1df4e5fe5d884f524983b2b5fcd6cde Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 27 Jun 2024 00:29:11 +0900 Subject: [PATCH 2/4] fix #250: bump patch version macro in version.hpp --- include/toml11/version.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/toml11/version.hpp b/include/toml11/version.hpp index acec049..778fc2b 100644 --- a/include/toml11/version.hpp +++ b/include/toml11/version.hpp @@ -3,7 +3,7 @@ #define TOML11_VERSION_MAJOR 4 #define TOML11_VERSION_MINOR 0 -#define TOML11_VERSION_PATCH 0 +#define TOML11_VERSION_PATCH 1 #ifndef __cplusplus # error "__cplusplus is not defined" From 8596419e24ff4ad386ecbf44d2c7ec7db5aedd05 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Wed, 26 Jun 2024 15:31:25 +0000 Subject: [PATCH 3/4] feat [skip ci]: update single_include --- single_include/toml.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/single_include/toml.hpp b/single_include/toml.hpp index ac4455d..51038e0 100644 --- a/single_include/toml.hpp +++ b/single_include/toml.hpp @@ -3,7 +3,7 @@ #define TOML11_VERSION_MAJOR 4 #define TOML11_VERSION_MINOR 0 -#define TOML11_VERSION_PATCH 0 +#define TOML11_VERSION_PATCH 1 #ifndef __cplusplus # error "__cplusplus is not defined" From 42734ea6422415016262f65e9b3c02e1eef8fd19 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 28 Jun 2024 00:07:26 +0900 Subject: [PATCH 4/4] fix: typo in type-trait impl --- include/toml11/traits.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/toml11/traits.hpp b/include/toml11/traits.hpp index 54adf8e..0a0fa79 100644 --- a/include/toml11/traits.hpp +++ b/include/toml11/traits.hpp @@ -95,7 +95,7 @@ struct has_specialized_into_impl template static std::false_type check(...); template)> - static std::true_type check(::toml::from*); + static std::true_type check(::toml::into*); };