소스 검색

curl: Restore CMake-specific zlib selection code

Brad King 11 년 전
부모
커밋
681693c993
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      Utilities/cmcurl/CMakeLists.txt

+ 14 - 1
Utilities/cmcurl/CMakeLists.txt

@@ -25,7 +25,6 @@ set(CURL_HIDDEN_SYMBOLS OFF CACHE INTERNAL "No curl hidden symbols")
 set(CURL_LDAP_WIN OFF CACHE INTERNAL "No curl Windows LDAP")
 set(CURL_LDAP_WIN OFF CACHE INTERNAL "No curl Windows LDAP")
 set(CURL_STATICLIB ON CACHE INTERNAL "Static curl")
 set(CURL_STATICLIB ON CACHE INTERNAL "Static curl")
 set(CURL_USE_ARES OFF CACHE INTERNAL "No curl c-ares support")
 set(CURL_USE_ARES OFF CACHE INTERNAL "No curl c-ares support")
-set(CURL_ZLIB ON CACHE INTERNAL "Enable curl zlib")
 set(DISABLED_THREADSAFE OFF CACHE INTERNAL "Curl can use thread-safe functions")
 set(DISABLED_THREADSAFE OFF CACHE INTERNAL "Curl can use thread-safe functions")
 set(ENABLE_IPV6 OFF CACHE INTERNAL "Curl IPv6 support")
 set(ENABLE_IPV6 OFF CACHE INTERNAL "Curl IPv6 support")
 set(HTTP_ONLY OFF CACHE INTERNAL "Curl is not http-only")
 set(HTTP_ONLY OFF CACHE INTERNAL "Curl is not http-only")
@@ -383,6 +382,7 @@ check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
 # For other tests to use the same libraries
 # For other tests to use the same libraries
 set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBS})
 set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBS})
 
 
+if(0) # This code not needed for building within CMake.
 option(CURL_ZLIB "Set to ON to enable building cURL with zlib support." ON)
 option(CURL_ZLIB "Set to ON to enable building cURL with zlib support." ON)
 set(HAVE_LIBZ OFF)
 set(HAVE_LIBZ OFF)
 set(HAVE_ZLIB_H OFF)
 set(HAVE_ZLIB_H OFF)
@@ -396,6 +396,19 @@ if(CURL_ZLIB)
     list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
     list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
   endif()
   endif()
 endif()
 endif()
+endif()
+
+#-----------------------------------------------------------------------------
+# CMake-specific curl code.
+
+if(CURL_SPECIAL_LIBZ)
+  set(CURL_LIBS ${CURL_LIBS} "${CURL_SPECIAL_LIBZ}")
+  include_directories(${CURL_SPECIAL_LIBZ_INCLUDES})
+  set(HAVE_LIBZ 0)
+  set(HAVE_ZLIB_H 0)
+endif()
+
+#-----------------------------------------------------------------------------
 
 
 option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" OFF)
 option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" OFF)
 mark_as_advanced(CMAKE_USE_OPENSSL)
 mark_as_advanced(CMAKE_USE_OPENSSL)