Revision: 65374
          http://sourceforge.net/p/brlcad/code/65374
Author:   starseeker
Date:     2015-06-18 00:17:09 +0000 (Thu, 18 Jun 2015)
Log Message:
-----------
Try another approach to ws2_32 testing...

Modified Paths:
--------------
    brlcad/trunk/CMakeLists.txt

Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2015-06-17 23:41:09 UTC (rev 65373)
+++ brlcad/trunk/CMakeLists.txt 2015-06-18 00:17:09 UTC (rev 65374)
@@ -1798,7 +1798,16 @@
 BRLCAD_CHECK_LIBRARY(SOLARIS_LEXER l yyless)
 
 # Windows ws2_32 library
-BRLCAD_CHECK_LIBRARY(WS2_32 ws2_32 gethostname)
+if("${HAVE_WS2_32_LIBRARY}" MATCHES "^${HAVE_WS2_32_LIBRARY}$")
+  set(CMAKE_REQUIRED_LIBRARIES_BAK ${CMAKE_REQUIRED_LIBRARIES})
+  set(CMAKE_REQUIRED_LIBRARIES "ws2_32.lib")
+  check_c_source_runs("#include <windows.h>\nint main() {char name[32]; 
(void)gethostname(name, 32); return 0;}" HAVE_WS2_32_LIBRARY)
+  if(HAVE_WS2_32_LIBRARY)
+    set(WS2_32_LIBRARY "ws2_32.lib")
+    set(WINSOCK_LIB "ws2_32.lib")
+  endif(HAVE_WS2_32_LIBRARY)
+  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_BAK})
+endif("${HAVE_WS2_32_LIBRARY}" MATCHES "^${HAVE_WS2_32_LIBRARY}$")
 
 # timeSetEvent in Windows memory management
 if("${HAVE_TIMESETEVENT}" MATCHES "^${HAVE_TIMESETEVENT}$")

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to