CMake support for windows completed

1 fixes a few warnings.
2. we should use _WIN32 not WIN32 and a #define to determine platform
3. Cmake now has support for both shared and static builds on windows
4. Windows can now be build with cmake for both mingw64 and visual studio