Merge pull request #271 from SeverinLeonhardt/CMP0127

Fix use with CMake 3.21 and older
This commit is contained in:
Toru Niina 2024-08-29 21:30:14 +09:00 committed by GitHub
commit 4b74012723
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,9 @@ option(TOML11_PRECOMPILE "precompile toml11 library" OFF)
include(CMakeDependentOption) include(CMakeDependentOption)
cmake_policy(PUSH) cmake_policy(PUSH)
if(POLICY CMP0127)
cmake_policy(SET CMP0127 OLD) # syntax of condition changed in 3.22 cmake_policy(SET CMP0127 OLD) # syntax of condition changed in 3.22
endif()
cmake_dependent_option(TOML11_INSTALL "install toml11 library" ON cmake_dependent_option(TOML11_INSTALL "install toml11 library" ON
"${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF) "${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF)
cmake_dependent_option(TOML11_BUILD_EXAMPLES "build toml11 examples" OFF cmake_dependent_option(TOML11_BUILD_EXAMPLES "build toml11 examples" OFF