Merge pull request #877 from fanc999/master.msvc

Fix CMake builds on Windows, MSVC in particular