cmake and MSVC compatibility fixes