aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-07-15 19:25:22 +0000
committerBill Hoffman <bill.hoffman@kitware.com>2009-07-15 19:25:22 +0000
commitfb08218a0409bdae7ccdc647ffdddf72c3c5fe61 (patch)
treea8679a038674a3155577297f079a33fe5c075f6d
parent08d95bff5e919a59f91417af091a34cea6004e3d (diff)
BUG: curl did not build with cmake with VS 2005 for two reasons, ws2tcpip.h requires winsock2.h to be included before it with that compiler, and wldap32 is not available with the default install of the compiler, so disable ldap support if that is not found
-rw-r--r--CMake/CheckTypeSize.c.in1
-rw-r--r--CMakeLists.txt13
-rw-r--r--include/curl/curlbuild.h.cmake1
3 files changed, 13 insertions, 2 deletions
diff --git a/CMake/CheckTypeSize.c.in b/CMake/CheckTypeSize.c.in
index ba8d3044c..9e48df153 100644
--- a/CMake/CheckTypeSize.c.in
+++ b/CMake/CheckTypeSize.c.in
@@ -8,6 +8,7 @@
#ifdef _WIN32
+# include <winsock2.h>
# include <ws2tcpip.h>
#endif
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51349657a..cf9d0d585 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,7 +76,6 @@ if(CURL_USE_ARES)
set(USE_ARES ${CURL_USE_ARES})
find_package(CARES REQUIRED)
list(APPEND CURL_LIBS ${CARES_LIBRARY} )
- message("CURL_LIBS = ${CURL_LIBS}")
set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
endif()
@@ -119,7 +118,15 @@ mark_as_advanced(CURL_DISABLE_HTTP)
option(CURL_DISABLE_LDAPS "to disable LDAPS" OFF)
mark_as_advanced(CURL_DISABLE_LDAPS)
if(WIN32)
- option(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
+ set(CURL_DEFAULT_DISABLE_LDAP OFF)
+ # some windows compilers do not have wldap32
+ if( NOT HAVE_WLDAP32)
+ set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
+ message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
+ option(CURL_LDAP_WIN "Use W$ LDAP implementation" OFF)
+ else()
+ option(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
+ endif()
mark_as_advanced(CURL_LDAP_WIN)
set(CURL_LDAP_HYBRID OFF)
else()
@@ -226,6 +233,8 @@ endif(NOT NOT_NEED_LIBNSL)
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
+check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32)
+
# IF(NOT CURL_SPECIAL_LIBZ)
# CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ)
# ENDIF(NOT CURL_SPECIAL_LIBZ)
diff --git a/include/curl/curlbuild.h.cmake b/include/curl/curlbuild.h.cmake
index 0173a215f..afa1316c0 100644
--- a/include/curl/curlbuild.h.cmake
+++ b/include/curl/curlbuild.h.cmake
@@ -140,6 +140,7 @@
/* on windows socklen_t is in here */
#ifdef _WIN32
+# include <winsock2.h>
# include <ws2tcpip.h>
#endif