Msvc cmake fixes

Fix building on Windows with Visual Studio 2010 and CMake.