[CMake] Finding WS2 library on Windows Vista

Clinton Stimpson clinton at elemtech.com
Fri Jul 2 14:44:00 EDT 2010


On Friday, July 02, 2010 11:56:02 am Di Zou wrote:
> I am trying to use CMake to find WS2_32.dll on Windows Vista. For me, the
> dll is located in C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib. So I
> use the command: FIND_LIBRARY(WS2 NAMES WS2_32 PATHS "C:/Program
> Files/Microsoft SDKs/Windows/*" "C:/Program Files/Microsoft
> SDKs/Windows/*/*") This command works on my computer, but I would like to
> make it more generic. I tried FIND_PACKAGE(WS2 REQUIRED) but that did not
> find anything. Is there a module available to find the WS2_32.dll? Also,
> is there a default or common location for WS2_32.dll?

If its part of the Windows SDK, I think its as simple as
target_link_libraries(foo ws2_32)

Clint


More information about the CMake mailing list