You should try not to use compiler specific code in the cmake scripts,
because if not implemented carefully it can hurt cross compilation using
other compilers, in this case for example mingw instead of msvc. All
compiler specific settings should be implemented in cmake toolchain
files, everything else bloats your build scripts in a best case. In a
worst case it ruins your build procedure completely.
You should try not to use compiler specific code in the cmake scripts, because if not implemented carefully it can hurt cross compilation using other compilers, in this case for example mingw instead of msvc. All compiler specific settings should be implemented in cmake toolchain files, everything else bloats your build scripts in a best case. In a worst case it ruins your build procedure completely.