Some fixes to cmake mingw32. WIP still some linker errors