MSVC cmake improvements

Some improvements in MSVC support:
- a workaround for a cmake bug
- an option for selecting static/dynamic CRT versions