From 43c9c95de850b0f039927e744c1c3dca96ff6edf Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 6 Jul 2024 14:48:55 +0900 Subject: [PATCH] chore: avoid cmake compatibility warning --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e639691..dfa14555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,13 @@ string(REGEX REPLACE "#define TOML11_VERSION_PATCH ([0-9]+)" "\\1" TOML11_VERSIO project(toml11 LANGUAGES CXX VERSION "${TOML11_VERSION_MAJOR}.${TOML11_VERSION_MINOR}.${TOML11_VERSION_PATCH}") -include(CMakeDependentOption) -include(CTest) +include(CTest) # to use ${BUILD_TESTING} option(TOML11_PRECOMPILE "precompile toml11 library" OFF) +include(CMakeDependentOption) +cmake_policy(PUSH) +cmake_policy(SET CMP0127 OLD) # syntax of condition changed in 3.22 cmake_dependent_option(TOML11_INSTALL "install toml11 library" ON "${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF) cmake_dependent_option(TOML11_BUILD_EXAMPLES "build toml11 examples" OFF @@ -27,6 +29,8 @@ cmake_dependent_option(TOML11_BUILD_TESTS "build toml11 unit tests" OFF "${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}; ${BUILD_TESTING}" OFF) cmake_dependent_option(TOML11_BUILD_TOML_TESTS "build toml11 toml-test encoder & decoder" OFF "${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF) +cmake_policy(POP) + cmake_dependent_option(TOML11_TEST_WITH_ASAN "build toml11 unit tests with asan" OFF "${TOML11_BUILD_TESTS}" OFF) cmake_dependent_option(TOML11_TEST_WITH_UBSAN "build toml11 unit tests with ubsan" OFF