[Core/CMake] Check that policy exists before setting to old