Fix cmake errors in msvc