cmake_policy: Failing minimum cmake version constraint doesn't stop further processing
While comparing the behavior of
cmake_minimum_required(VERSION min...max) and
cmake_policy(VERSION min...max), it was discovered that the former will halt further processing if the currently used CMake version is less than
min, but the latter does not. Both issue an error message and ultimately result in the configure stage failing, but
cmake_policy() shouldn't allow further processing if the minimum CMake version constraint is not met.
I think the problem is that the return value of
SetPolicyVersion() is discarded instead of being returned to the caller here.