cygwin compatibility with detection of compiler in CMakeLists.txt

Here is the revised commit