Fix the cmake macros to work with the new cmake changes. Add a patch to correct the handling of file sizes with 32 bit size_t on 32 bit architectures.