fixed compilation errors.
update cmakefiles to accommodate msvc