Fix CMake deprecation warning for compatibility with CMake < 3.10 (#1659)
* Fix uninitialized CMake variable in version.in
CMake's project() command sets jsoncpp_VERSION (lowercase prefix),
not JSONCPP_VERSION. The wrong variable caused the generated version
file to be empty.
Fixes #1656
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix CMake deprecation warning for compatibility with CMake < 3.10
Bump JSONCPP_OLDEST_VALIDATED_POLICIES_VERSION from 3.8.0 to 3.10.0
to silence the CMake 3.31 deprecation warning.
Fixes #1598
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4eb4499..cfd1a4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
# CMake versions greater than the JSONCPP_NEWEST_VALIDATED_POLICIES_VERSION policies will
# continue to generate policy warnings "CMake Warning (dev)...Policy CMP0XXX is not set:"
#
-set(JSONCPP_OLDEST_VALIDATED_POLICIES_VERSION "3.8.0")
+set(JSONCPP_OLDEST_VALIDATED_POLICIES_VERSION "3.10.0")
set(JSONCPP_NEWEST_VALIDATED_POLICIES_VERSION "3.13.2")
cmake_minimum_required(VERSION ${JSONCPP_OLDEST_VALIDATED_POLICIES_VERSION})
if("${CMAKE_VERSION}" VERSION_LESS "${JSONCPP_NEWEST_VALIDATED_POLICIES_VERSION}")