Commit 0a3a220f by Laurent Stacul

Discover libssh2 without pkg-config

parent f1b89a20
# LIBSSH2_FOUND - system has the libssh2 library
# LIBSSH2_INCLUDE_DIR - the libssh2 include directory
# LIBSSH2_LIBRARY - the libssh2 library name
FIND_PATH(LIBSSH2_INCLUDE_DIR libssh2.h)
FIND_LIBRARY(LIBSSH2_LIBRARY NAMES ssh2 libssh2)
INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibSSH2
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
...@@ -232,6 +232,13 @@ ENDIF() ...@@ -232,6 +232,13 @@ ENDIF()
# Optional external dependency: libssh2 # Optional external dependency: libssh2
IF (USE_SSH) IF (USE_SSH)
FIND_PKGLIBRARIES(LIBSSH2 libssh2) FIND_PKGLIBRARIES(LIBSSH2 libssh2)
IF (NOT LIBSSH2_FOUND)
FIND_PACKAGE(LibSSH2)
SET(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
GET_FILENAME_COMPONENT(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY)
SET(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
SET(LIBSSH2_LDFLAGS "-lssh2")
ENDIF()
ENDIF() ENDIF()
IF (LIBSSH2_FOUND) IF (LIBSSH2_FOUND)
SET(GIT_SSH 1) SET(GIT_SSH 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment