| 1 |
# - Try to find the libssh2 library |
| 2 |
# Once done this will define |
| 3 |
# |
| 4 |
# LIBSSH2_FOUND - system has the libssh2 library |
| 5 |
# LIBSSH2_INCLUDE_DIR - the libssh2 include directory |
| 6 |
# LIBSSH2_LIBRARY - the libssh2 library name |
| 7 |
|
| 8 |
find_path(LIBSSH2_INCLUDE_DIR libssh2.h) |
| 9 |
|
| 10 |
find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2) |
| 11 |
|
| 12 |
if(LIBSSH2_INCLUDE_DIR) |
| 13 |
file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION[\t ]+\"(.*)\"") |
| 14 |
string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBSSH2_VERSION "${libssh2_version_str}") |
| 15 |
endif() |
| 16 |
|
| 17 |
include(FindPackageHandleStandardArgs) |
| 18 |
find_package_handle_standard_args(LibSSH2 |
| 19 |
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR |
| 20 |
VERSION_VAR LIBSSH2_VERSION) |
| 21 |
|
| 22 |
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) |