Hey All,<div><br></div><div>I'm trying to work my way through some windows configuration and running into problems. I'm trying a few things: looking for headers, looking for lib files, and looking for functions/symbols in them. I'm particularly interested in Winsock stuff right now.</div>
<div><br></div><div>I have a couple things hard coded for the moment just to get this working. Here's what I have so far:</div><div><br></div><div><div>if(PLATFORM_WINDOWS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>set(WINDOWS_SDK_LIBRARIES "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86")</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>set(WINDOWS_SDK_INCLUDES "C:/Program Files (x86)/Windows Kits/8.0/Include/um")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>set(CMAKE_LIBRARY_PATH ${WINDOWS_SDK_LIBRARIES})</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>set(CMAKE_INCLUDE_PATH ${WINDOWS_SDK_INCLUDES})</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>check_include_file(Windows.h HAVE_WINDOWS_H)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>check_include_file(WinSock2.h HAVE_WINSOCK2_H)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>check_include_file(WS2tcpip.h HAVE_WS2TCPIP_H)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>check_include_file(IPHlpApi.h HAVE_IPHLPAPI_H)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>set(_REQUIRED_INCLUDES Winsock2.h)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>set(_REQUIRED_LIBRARIES WS2_32.lib WSock32.lib)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>set(CMAKE_REQUIRED_INCLUDES ${_REQUIRED_INCLUDES})</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>set(CMAKE_REQUIRED_LIBRARIES ${_REQUIRED_LIBRARIES})</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>check_library_exists(WS2_32 select WINDOWS_SDK_LIBRARIES HAVE_WS2_32_lib)</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>check_library_exists(WSock32 select WINDOWS_SDK_LIBRARIES HAVE_WSOCK32_lib)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//tried these too</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>//check_library_exists(WS2_32.lib select WINDOWS_SDK_LIBRARIES HAVE_WS2_32_lib)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//check_library_exists(WSock32.lib select WINDOWS_SDK_LIBRARIES HAVE_WSOCK32_lib)</div>
<div>endif()</div></div><div><br></div><div>And here's the output:</div><div><br></div><div><div>Looking for Windows.h</div><div>Looking for Windows.h - found</div><div>Looking for WinSock2.h</div><div>Looking for WinSock2.h - found</div>
<div>Looking for WS2tcpip.h</div><div>Looking for WS2tcpip.h - found</div><div>Looking for IPHlpApi.h</div><div>Looking for IPHlpApi.h - not found</div><div>Looking for select in WS2_32</div><div>Looking for select in WS2_32 - not found</div>
<div>Looking for select in WSock32</div><div>Looking for select in WSock32 - not found</div></div><div><br></div><div>A few interesting things about the results:</div><div>-IPHlpApi.h header, it says not found but it clearly exists in C:\Program Files (x86)\Windows Kits\8.0\Include\um\IPHlpApi.h</div>
<div>-WS2_32.lib, it says not found but it exists at C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86/WS2_32.lib</div><div>-WSock32.lib, it says not found but it exists at C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86/WSock32.lib</div>
<div>-I'm checking for the "select" function which according to MSDN exists in WS2_32.lib</div><div><br></div><div>Is there a way to check for .lib files without required a function? Wondering if that's the issue with finding the winsock lib files. If so, then how would I make sure select exists? I could probably just assume it exists after finding the lib files, but I need successful tests first.</div>
<div><br></div><div>Any help is much appreciated.</div><div>Thanks!</div><div><br></div>