made CMake scripts more conveniently

fixed some MSVC warnings related to the numeric casts