# LIBGSASL_FOUND System has libgsasl
# LIBGSASL_INCLUDE_DIRS The libgsasl include directories
# LIBGSASL_LIBRARIES The libgsasl library names
+# LIBGSASL_LIBRARY_DIRS The libgsasl library directories
+# LIBGSASL_CFLAGS Required compiler flags
# LIBGSASL_VERSION Version of libgsasl
if(CURL_USE_PKGCONFIG AND
endif()
if(LIBGSASL_FOUND)
- set(LIBGSASL_LIBRARIES ${LIBGSASL_LINK_LIBRARIES})
+ string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
else()
find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h")
# LIBIDN2_FOUND System has libidn2
# LIBIDN2_INCLUDE_DIRS The libidn2 include directories
# LIBIDN2_LIBRARIES The libidn2 library names
+# LIBIDN2_LIBRARY_DIRS The libidn2 library directories
+# LIBIDN2_CFLAGS Required compiler flags
# LIBIDN2_VERSION Version of libidn2
if(CURL_USE_PKGCONFIG AND
endif()
if(LIBIDN2_FOUND)
- set(LIBIDN2_LIBRARIES ${LIBIDN2_LINK_LIBRARIES})
+ string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
else()
find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h")
# LIBSSH_FOUND System has libssh
# LIBSSH_INCLUDE_DIRS The libssh include directories
# LIBSSH_LIBRARIES The libssh library names
+# LIBSSH_LIBRARY_DIRS The libssh library directories
+# LIBSSH_CFLAGS Required compiler flags
# LIBSSH_VERSION Version of libssh
if(CURL_USE_PKGCONFIG AND
endif()
if(LIBSSH_FOUND)
- if(NOT DEFINED LIBSSH_LINK_LIBRARIES)
- set(LIBSSH_LINK_LIBRARIES ${LIBSSH_LIBRARIES}) # Workaround for some systems (seen on Old Linux CI)
- endif()
- set(LIBSSH_LIBRARIES ${LIBSSH_LINK_LIBRARIES})
+ string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
else()
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
# LIBUV_FOUND System has libuv
# LIBUV_INCLUDE_DIRS The libuv include directories
# LIBUV_LIBRARIES The libuv library names
+# LIBUV_LIBRARY_DIRS The libuv library directories
+# LIBUV_CFLAGS Required compiler flags
# LIBUV_VERSION Version of libuv
if(CURL_USE_PKGCONFIG AND
endif()
if(LIBUV_FOUND)
- set(LIBUV_LIBRARIES ${LIBUV_LINK_LIBRARIES})
+ string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
else()
find_path(LIBUV_INCLUDE_DIR NAMES "uv.h")
# NETTLE_FOUND System has nettle
# NETTLE_INCLUDE_DIRS The nettle include directories
# NETTLE_LIBRARIES The nettle library names
+# NETTLE_LIBRARY_DIRS The nettle library directories
+# NETTLE_CFLAGS Required compiler flags
# NETTLE_VERSION Version of nettle
if(CURL_USE_PKGCONFIG AND
endif()
if(NETTLE_FOUND)
- set(NETTLE_LIBRARIES ${NETTLE_LINK_LIBRARIES})
+ string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
else()
find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h")
# Initialize CURL_LIBS
set(CURL_LIBS "")
+set(CURL_LIBDIRS "")
set(LIBCURL_PC_REQUIRES_PRIVATE "")
if(ENABLE_ARES)
set(_ssl_enabled ON)
set(USE_GNUTLS ON)
list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES})
+ list(APPEND CURL_LIBDIRS ${NETTLE_LIBRARY_DIRS})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gnutls" "nettle")
include_directories(${GNUTLS_INCLUDE_DIRS} ${NETTLE_INCLUDE_DIRS})
+ link_directories(${NETTLE_LIBRARY_DIRS})
+ if(NETTLE_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NETTLE_CFLAGS}")
+ endif()
if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "gnutls")
set(_valid_default_ssl_backend TRUE)
find_package(Libidn2)
if(LIBIDN2_FOUND)
set(CURL_LIBS "${LIBIDN2_LIBRARIES};${CURL_LIBS}")
+ list(APPEND CURL_LIBDIRS ${LIBIDN2_LIBRARY_DIRS})
set(LIBCURL_PC_REQUIRES_PRIVATE "libidn2;${LIBCURL_PC_REQUIRES_PRIVATE}")
include_directories(${LIBIDN2_INCLUDE_DIRS})
+ link_directories(${LIBIDN2_LIBRARY_DIRS})
+ if(LIBIDN2_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBIDN2_CFLAGS}")
+ endif()
set(HAVE_IDN2_H 1)
set(HAVE_LIBIDN2 1)
endif()
find_package(Libssh REQUIRED)
if(LIBSSH_FOUND)
list(APPEND CURL_LIBS ${LIBSSH_LIBRARIES})
+ list(APPEND CURL_LIBDIRS ${LIBSSH_LIBRARY_DIRS})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh")
include_directories(${LIBSSH_INCLUDE_DIRS})
+ link_directories(${LIBSSH_LIBRARY_DIRS})
+ if(LIBSSH_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBSSH_CFLAGS}")
+ endif()
set(USE_LIBSSH ON)
endif()
endif()
find_package(Libgsasl REQUIRED)
if(LIBGSASL_FOUND)
list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES})
+ list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libgsasl")
+ include_directories(${LIBGSASL_INCLUDE_DIRS})
+ link_directories(${LIBGSASL_LIBRARY_DIRS})
+ if(LIBGSASL_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBGSASL_CFLAGS}")
+ endif()
set(USE_GSASL ON)
endif()
endif()
find_package(Libuv REQUIRED)
if(LIBUV_FOUND)
list(APPEND CURL_LIBS ${LIBUV_LIBRARIES})
+ list(APPEND CURL_LIBDIRS ${LIBUV_LIBRARY_DIRS})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libuv")
include_directories(${LIBUV_INCLUDE_DIRS})
+ link_directories(${LIBUV_LIBRARY_DIRS})
+ if(LIBUV_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUV_CFLAGS}")
+ endif()
set(USE_LIBUV ON)
set(HAVE_UV_H ON)
endif()
endif()
endforeach()
+ foreach(_lib IN LISTS CURL_LIBDIRS)
+ set(LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE} -L${_lib}")
+ endforeach()
+
foreach(_lib IN LISTS CMAKE_C_IMPLICIT_LINK_LIBRARIES CURL_LIBS)
if(TARGET "${_lib}")
set(_libname "${_lib}")