bagder/curl — pull request #131 by snikulov (2014-12-23 21:28:07+00:00)
Title: cmake // fixed winsock2 detection on windows

Hello Daniel!

Curl cmake build was regressed for MSVC since some past re-factoring.

The issue related to winsock2 detection after openssl already found. It will include windows.h first.
In this case - winsock2 check will fail and HAVE_WINSOCK2_H and HAVE_WS2TCPIP_H marked as not found (issue described here http://stackoverflow.com/questions/1372480/c-redefinition-header-files).

I've solve this issue by explicit definition -D_WINSOCKAPI_ in CMAKE_REQUIRED_DEFINITIONS for WIN32 build generation.
Also I've fixed tools_hugehelp.c generation using "cmake -E echo" command.

Could you please review and integrate?
Thank you.

P.S.
cmake build tested on Windows 7+ with MSVC 2013 && MSVC 2012 && MinGW 4.8.3 / CentOS 7 with gcc 4.8.2