cmake: support static runtime (MSVC) Fixes: #737 (cherry picked from commit 246f44041e0782f728fa5ff2d39113005a1ab02d)