jsoncppConfig.cmake.in contains:
|
cmake_policy(VERSION 3.0...3.26) |
CMake 4.0 has removed compatibility with policy versions below 3.5:
Compatibility with versions of CMake older than 3.5 has been removed.
So any project using find_package(jsoncpp) with CMake 4.0+ fails with:
CMake Error at .../jsoncppConfig.cmake:2 (cmake_policy):
Compatibility with CMake < 3.5 has been removed from CMake.
This was reported in #1604 but was closed based on a suggestion to bump the max instead of the min. That was a misunderstanding -- the error is about the min (3.0), not the max. CMake 4.0 rejects any cmake_policy(VERSION) or cmake_minimum_required(VERSION) with a minimum below 3.5, regardless of the max.
jsoncppConfig.cmake.incontains:jsoncpp/jsoncppConfig.cmake.in
Line 2 in cdc8483
CMake 4.0 has removed compatibility with policy versions below 3.5:
So any project using
find_package(jsoncpp)with CMake 4.0+ fails with:This was reported in #1604 but was closed based on a suggestion to bump the max instead of the min. That was a misunderstanding -- the error is about the min (
3.0), not the max. CMake 4.0 rejects anycmake_policy(VERSION)orcmake_minimum_required(VERSION)with a minimum below3.5, regardless of the max.