Make sure that Ninja knows the version header (fixes #4209)
This is required, because Ninja otherwise doesn't properly rebuild after updating the version string header file.
Because BYPRODUCTS requires CMake 3.2, bump the minimum version and remove now unused compatibility code for older CMake versions.
Edited by Simon Richter