It's sys/socket.h OR ws2tcpip.h, not MAYBE AND.
@@ -193,9 +193,7 @@ check_include_file (ws2tcpip.h HAVE_WS2TCPIP_H)
if (HAVE_SOCKET_H)
list (APPEND CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
-endif()
-
-if (HAVE_WS2TCPIP_H)
+elseif (HAVE_WS2TCPIP_H)
list (APPEND CMAKE_EXTRA_INCLUDE_FILES ws2tcpip.h)
endif()
