Added CMake file.
Fixed compiling CMake project under MSVC.