endif()
set(_curl_ca_bundle_supported TRUE)
+ cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
if(NOT DEFINED HAVE_BORINGSSL)
check_symbol_exists("OPENSSL_IS_BORINGSSL" "openssl/base.h" HAVE_BORINGSSL)
if(NOT DEFINED HAVE_AWSLC)
check_symbol_exists("OPENSSL_IS_AWSLC" "openssl/base.h" HAVE_AWSLC)
endif()
+ cmake_pop_check_state()
endif()
if(CURL_USE_MBEDTLS)
# Now that we know, we are not using Windows LDAP...
if(NOT USE_WIN32_LDAP)
# Check for LDAP
- unset(CMAKE_REQUIRED_LIBRARIES)
+ cmake_push_check_state()
if(USE_OPENSSL)
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
endif()
check_library_exists("${CMAKE_LBER_LIB}" "ber_init" "" HAVE_LIBLBER)
endif()
- set(CMAKE_REQUIRED_INCLUDES_BAK ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_LDAP_INCLUDE_DIR "" CACHE STRING "Path to LDAP include directory")
if(CMAKE_LDAP_INCLUDE_DIR)
list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_LDAP_INCLUDE_DIR})
if(NOT HAVE_LDAP_H)
message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON")
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
- set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) # LDAP includes will not be used
- unset(CMAKE_REQUIRED_LIBRARIES)
elseif(NOT HAVE_LIBLDAP)
message(STATUS "LDAP library '${CMAKE_LDAP_LIB}' not found CURL_DISABLE_LDAP set ON")
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
- set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) # LDAP includes will not be used
- unset(CMAKE_REQUIRED_LIBRARIES)
else()
if(CMAKE_LDAP_INCLUDE_DIR)
include_directories(SYSTEM ${CMAKE_LDAP_INCLUDE_DIR})
check_function_exists("ldap_url_parse" HAVE_LDAP_URL_PARSE)
check_function_exists("ldap_init_fd" HAVE_LDAP_INIT_FD)
- unset(CMAKE_REQUIRED_LIBRARIES)
-
check_include_file("ldap_ssl.h" HAVE_LDAP_SSL_H)
if(HAVE_LDAP_INIT_FD)
set(HAVE_LDAP_SSL ON)
endif()
endif()
+ cmake_pop_check_state()
endif()
endif()
set(HAVE_GSSAPI ${GSS_FOUND})
if(GSS_FOUND)
+ cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS})
string(REPLACE ";" " " GSS_CFLAGS "${GSS_CFLAGS}")
set(CMAKE_REQUIRED_FLAGS "${GSS_CFLAGS} ${GSS_LDFLAGS}")
set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" ${_include_list} HAVE_GSS_C_NT_HOSTBASED_SERVICE)
- unset(CMAKE_REQUIRED_LIBRARIES)
endif()
if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE)
set(HAVE_OLD_GSSMIT ON)
endif()
endif()
endif()
+ cmake_pop_check_state()
include_directories(SYSTEM ${GSS_INCLUDE_DIRS})
link_directories(${GSS_LIBRARY_DIRS})
option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF)
if(USE_LIBRTMP)
- cmake_push_check_state()
set(_extra_libs "rtmp")
if(WIN32)
list(APPEND _extra_libs "winmm")
endif()
openssl_check_symbol_exists("RTMP_Init" "librtmp/rtmp.h" HAVE_LIBRTMP "${_extra_libs}")
- cmake_pop_check_state()
if(HAVE_LIBRTMP)
list(APPEND CURL_LIBS "rtmp")
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "librtmp")
curl_internal_test(HAVE_FSETXATTR_6)
endif()
+cmake_push_check_state()
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T)
set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T})
-set(CMAKE_EXTRA_INCLUDE_FILES "")
+cmake_pop_check_state()
if(WIN32)
+ cmake_push_check_state()
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY)
set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY})
- set(CMAKE_EXTRA_INCLUDE_FILES "")
+ cmake_pop_check_state()
endif()
# Do curl specific tests
curl_internal_test(${_curl_test})
endforeach()
+cmake_push_check_state()
if(HAVE_FILE_OFFSET_BITS)
set(_FILE_OFFSET_BITS 64)
set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
# Include this header to get the type
+cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include")
set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h")
check_type_size("curl_off_t" SIZEOF_CURL_OFF_T)
set(CMAKE_EXTRA_INCLUDE_FILES "curl/curl.h")
check_type_size("curl_socket_t" SIZEOF_CURL_SOCKET_T)
-set(CMAKE_EXTRA_INCLUDE_FILES "")
+cmake_pop_check_state() # pop curl system headers
+cmake_pop_check_state() # pop -D_FILE_OFFSET_BITS=64
if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
# On non-Windows and not cross-compiling, check for writable argv[]
}" HAVE_WRITABLE_ARGV)
endif()
-unset(CMAKE_REQUIRED_FLAGS)
-
curl_internal_test(HAVE_GLIBC_STRERROR_R)
curl_internal_test(HAVE_POSIX_STRERROR_R)