# BEARSSL_INCLUDE_DIRS The bearssl include directories
# BEARSSL_LIBRARIES The bearssl library names
-find_path(BEARSSL_INCLUDE_DIRS "bearssl.h")
+# for compatibility. Configuration via BEARSSL_INCLUDE_DIRS is deprecated, use BEARSSL_INCLUDE_DIR instead.
+if(DEFINED BEARSSL_INCLUDE_DIRS AND NOT DEFINED BEARSSL_INCLUDE_DIR)
+ set(BEARSSL_INCLUDE_DIR "${BEARSSL_INCLUDE_DIRS}")
+ unset(BEARSSL_INCLUDE_DIRS)
+endif()
+
+find_path(BEARSSL_INCLUDE_DIR "bearssl.h")
find_library(BEARSSL_LIBRARY "bearssl")
BEARSSL_LIBRARY
)
-mark_as_advanced(BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY)
+if(BEARSSL_FOUND)
+ set(BEARSSL_INCLUDE_DIRS ${BEARSSL_INCLUDE_DIR})
+ set(BEARSSL_LIBRARIES ${BEARSSL_LIBRARY})
+endif()
+
+mark_as_advanced(BEARSSL_INCLUDE_DIR BEARSSL_LIBRARY)
#
# Result Variables:
#
-# CARES_FOUND System has c-ares
-# CARES_INCLUDE_DIR The c-ares include directory
-# CARES_LIBRARY The c-ares library name
+# CARES_FOUND System has c-ares
+# CARES_INCLUDE_DIRS The c-ares include directories
+# CARES_LIBRARIES The c-ares library names
find_path(CARES_INCLUDE_DIR "ares.h")
CARES_LIBRARY
)
+if(CARES_FOUND)
+ set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
+ set(CARES_LIBRARIES ${CARES_LIBRARY})
+endif()
+
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
#
# GSS_FOUND System has the Heimdal library
# GSS_FLAVOUR "MIT" or "Heimdal" if anything found
-# GSS_INCLUDE_DIR The GSS include directory
+# GSS_INCLUDE_DIRS The GSS include directories
# GSS_LIBRARIES The GSS library names
# GSS_LINK_DIRECTORIES Directories to add to linker search path
# GSS_LINKER_FLAGS Additional linker flags
endif()
endif()
-set(GSS_INCLUDE_DIR ${_GSS_INCLUDE_DIRS})
+set(GSS_INCLUDE_DIRS ${_GSS_INCLUDE_DIRS})
set(GSS_LIBRARIES ${_GSS_LIBRARIES})
set(GSS_LINK_DIRECTORIES ${_GSS_LIBRARY_DIRS})
set(GSS_LINKER_FLAGS ${_GSS_LDFLAGS})
set(_heimdal_manifest_file "Heimdal.Application.x86.manifest")
endif()
- if(EXISTS "${GSS_INCLUDE_DIR}/${_heimdal_manifest_file}")
- file(STRINGS "${GSS_INCLUDE_DIR}/${_heimdal_manifest_file}" _heimdal_version_str
+ if(EXISTS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}")
+ file(STRINGS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}" _heimdal_version_str
REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$")
string(REGEX MATCH "[0-9]\\.[^\"]+" GSS_VERSION "${_heimdal_version_str}")
#
# Result Variables:
#
-# LIBPSL_FOUND System has libpsl
-# LIBPSL_INCLUDE_DIR The libpsl include directory
-# LIBPSL_LIBRARY The libpsl library name
-# LIBPSL_VERSION Version of libpsl
+# LIBPSL_FOUND System has libpsl
+# LIBPSL_INCLUDE_DIRS The libpsl include directories
+# LIBPSL_LIBRARIES The libpsl library names
+# LIBPSL_VERSION Version of libpsl
find_path(LIBPSL_INCLUDE_DIR "libpsl.h")
LIBPSL_VERSION
)
+if(LIBPSL_FOUND)
+ set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
+ set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY})
+endif()
+
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
#
# Result Variables:
#
-# LIBSSH2_FOUND System has libssh2
-# LIBSSH2_INCLUDE_DIR The libssh2 include directory
-# LIBSSH2_LIBRARY The libssh2 library name
-# LIBSSH2_VERSION Version of libssh2
+# LIBSSH2_FOUND System has libssh2
+# LIBSSH2_INCLUDE_DIRS The libssh2 include directories
+# LIBSSH2_LIBRARIES The libssh2 library names
+# LIBSSH2_VERSION Version of libssh2
find_path(LIBSSH2_INCLUDE_DIR "libssh2.h")
LIBSSH2_VERSION
)
+if(LIBSSH2_FOUND)
+ set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
+ set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
+endif()
+
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
# MBEDTLS_INCLUDE_DIRS The mbedtls include directories
# MBEDTLS_LIBRARIES The mbedtls library names
-find_path(MBEDTLS_INCLUDE_DIRS "mbedtls/ssl.h")
+# for compatibility. Configuration via MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.
+if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
+ set(MBEDTLS_INCLUDE_DIR "${MBEDTLS_INCLUDE_DIRS}")
+ unset(MBEDTLS_INCLUDE_DIRS)
+endif()
+
+find_path(MBEDTLS_INCLUDE_DIR "mbedtls/ssl.h")
find_library(MBEDTLS_LIBRARY "mbedtls")
find_library(MBEDX509_LIBRARY "mbedx509")
find_library(MBEDCRYPTO_LIBRARY "mbedcrypto")
-set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
-
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MbedTLS
REQUIRED_VARS
- MBEDTLS_INCLUDE_DIRS
+ MBEDTLS_INCLUDE_DIR
MBEDTLS_LIBRARY
MBEDX509_LIBRARY
MBEDCRYPTO_LIBRARY
)
-mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
+if(MBEDTLS_FOUND)
+ set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
+ set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
+endif()
+
+mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
if(ENABLE_ARES)
set(USE_ARES 1)
find_package(CARES REQUIRED)
- list(APPEND CURL_LIBS ${CARES_LIBRARY})
+ list(APPEND CURL_LIBS ${CARES_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libcares")
endif()
find_package(BearSSL REQUIRED)
set(_ssl_enabled ON)
set(USE_BEARSSL ON)
- list(APPEND CURL_LIBS ${BEARSSL_LIBRARY})
+ list(APPEND CURL_LIBS ${BEARSSL_LIBRARIES})
include_directories(${BEARSSL_INCLUDE_DIRS})
if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "bearssl")
if(CURL_USE_LIBPSL)
find_package(LibPSL)
if(LIBPSL_FOUND)
- list(APPEND CURL_LIBS ${LIBPSL_LIBRARY})
+ list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libpsl")
- list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}")
- include_directories(${LIBPSL_INCLUDE_DIR})
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIRS}")
+ include_directories(${LIBPSL_INCLUDE_DIRS})
set(USE_LIBPSL ON)
endif()
endif()
if(CURL_USE_LIBSSH2)
find_package(LibSSH2)
if(LIBSSH2_FOUND)
- list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
+ list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh2")
- list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
- include_directories(${LIBSSH2_INCLUDE_DIR})
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIRS}")
+ include_directories(${LIBSSH2_INCLUDE_DIRS})
set(USE_LIBSSH2 ON)
endif()
endif()
message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"")
- list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIR})
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS})
string(REPLACE ";" " " GSS_COMPILER_FLAGS "${GSS_COMPILER_FLAGS}")
string(REPLACE ";" " " GSS_LINKER_FLAGS "${GSS_LINKER_FLAGS}")
endif()
endif()
- include_directories(${GSS_INCLUDE_DIR})
+ include_directories(${GSS_INCLUDE_DIRS})
link_directories(${GSS_LINK_DIRECTORIES})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
"${CMAKE_CURRENT_SOURCE_DIR}"
)
if(USE_ARES)
- include_directories(${CARES_INCLUDE_DIR})
+ include_directories(${CARES_INCLUDE_DIRS})
endif()
if(BUILD_TESTING)
"${CURL_SOURCE_DIR}/tests/libtest" # to be able to build generated tests
)
if(USE_ARES)
- include_directories(${CARES_INCLUDE_DIR})
+ include_directories(${CARES_INCLUDE_DIRS})
endif()
target_link_libraries(${_test_name} ${LIB_SELECTED} ${CURL_LIBS})
"${CURL_SOURCE_DIR}/src" # for "tool_xattr.h" in disabled_SOURCES
)
if(USE_ARES)
- include_directories(${CARES_INCLUDE_DIR})
+ include_directories(${CARES_INCLUDE_DIRS})
endif()
target_link_libraries(${_test_name} ${CURL_LIBS})