File: FindSSH.cmake

package info (click to toggle)
kodi-vfs-sftp 2.0.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 176 kB
  • sloc: cpp: 714; makefile: 10
file content (24 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# - Try to find libssh
# Once done this will define
#
# SSH_FOUND - system has libssh
# SSH_INCLUDE_DIRS - the libssh include directory
# SSH_LIBRARIES - The libssh libraries

find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
  pkg_check_modules(PC_SSH libssh>=0.6 QUIET)
endif()

find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h PATHS ${PC_SSH_INCLUDEDIR})
find_library(SSH_LIBRARY NAMES ssh PATHS ${PC_SSH_LIBDIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SSH REQUIRED_VARS SSH_INCLUDE_DIR SSH_LIBRARY)

if(SSH_FOUND)
  set(SSH_LIBRARIES ${SSH_LIBRARY})
  set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR})
endif()

mark_as_advanced(SSH_INCLUDE_DIR SSH_LIBRARY)