Drop `find_package(libssh CONFIG)` detection method in favour of
the Find module that supports both `pkg-config`, and CMake-native
(since #14555) detection.
This aligns `libssh` detection with other dependencies. It makes the
build honor custom configuration via `LIBSSH_INCLUDE_DIR`,
`LIBSSH_LIBRARY`.
Also enable libssh in a GHA/macos cmake job for build coverage.
Fixing:
- curl-for-win requiring a hack to configure libssh:
https://github.com/curl/curl-for-win/blob/
4f9acbed92fd4aac0e874c9a591bec7d621cd9f2/curl.sh#L255-L263
- after #14555, GHA/windows gnutls vcpkg job no longer auto-detected
libssh, due to a regression missing to enable libssh when
found via `find_package(libssh CONFIG)`.
Ref: https://github.com/curl/curl/actions/runs/
10470138955/job/
28994650338
Follow-up to
422696f0a4f3a9e20d4ba9f12726bb066f1c34fc #14555
Closes #14614
install: gsasl
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON -DENABLE_WEBSOCKETS=ON
macos-version-min: '10.9'
- - name: 'OpenSSL +static'
- generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON
+ - name: 'OpenSSL +static libssh'
+ install: libssh
+ generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
macos-version-min: '10.9'
- name: 'SecureTransport ws debug+'
generate: -DCURL_USE_SECTRANSP=ON -DENABLE_WEBSOCKETS=ON -DENABLE_DEBUG=ON -DENABLE_CURLDEBUG=ON
option(CURL_USE_LIBSSH "Use libssh" OFF)
mark_as_advanced(CURL_USE_LIBSSH)
if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH)
- find_package(libssh CONFIG QUIET)
- if(libssh_FOUND)
- message(STATUS "Found libssh ${libssh_VERSION}")
- else()
- find_package(Libssh REQUIRED)
- if(LIBSSH_FOUND)
- list(APPEND CURL_LIBS ${LIBSSH_LIBRARIES})
- list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh")
- include_directories(${LIBSSH_INCLUDE_DIRS})
- set(USE_LIBSSH ON)
- endif()
+ find_package(Libssh REQUIRED)
+ if(LIBSSH_FOUND)
+ list(APPEND CURL_LIBS ${LIBSSH_LIBRARIES})
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh")
+ include_directories(${LIBSSH_INCLUDE_DIRS})
+ set(USE_LIBSSH ON)
endif()
endif()