mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 12:57:05 +00:00
Find libssh2 via pkg-config
We don't really need our own module to find libssh2. Using pkg-config lets the standard tool do the work for us and let us fit more naturally in the workflow as we respect the pkg-config search paths.
This commit is contained in:
parent
d43c7bd050
commit
4f91bfa32b
@ -212,7 +212,7 @@ ENDIF()
|
|||||||
|
|
||||||
# Optional external dependency: libssh2
|
# Optional external dependency: libssh2
|
||||||
IF (USE_SSH)
|
IF (USE_SSH)
|
||||||
FIND_PACKAGE(LIBSSH2)
|
PKG_CHECK_MODULES(LIBSSH2 libssh2)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF (LIBSSH2_FOUND)
|
IF (LIBSSH2_FOUND)
|
||||||
ADD_DEFINITIONS(-DGIT_SSH)
|
ADD_DEFINITIONS(-DGIT_SSH)
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
if (LIBSSH2_LIBRARIES AND LIBSSH2_INCLUDE_DIRS)
|
|
||||||
set(LIBSSH2_FOUND TRUE)
|
|
||||||
else (LIBSSH2_LIBRARIES AND LIBSSH2_INCLUDE_DIRS)
|
|
||||||
find_path(LIBSSH2_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
libssh2.h
|
|
||||||
PATHS
|
|
||||||
/usr/include
|
|
||||||
/usr/local/include
|
|
||||||
/opt/local/include
|
|
||||||
/sw/include
|
|
||||||
${CMAKE_INCLUDE_PATH}
|
|
||||||
${CMAKE_INSTALL_PREFIX}/include
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(LIBSSH2_LIBRARY
|
|
||||||
NAMES
|
|
||||||
ssh2
|
|
||||||
libssh2
|
|
||||||
PATHS
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/sw/lib
|
|
||||||
${CMAKE_LIBRARY_PATH}
|
|
||||||
${CMAKE_INSTALL_PREFIX}/lib
|
|
||||||
)
|
|
||||||
|
|
||||||
if (LIBSSH2_INCLUDE_DIR AND LIBSSH2_LIBRARY)
|
|
||||||
set(LIBSSH2_FOUND TRUE)
|
|
||||||
endif (LIBSSH2_INCLUDE_DIR AND LIBSSH2_LIBRARY)
|
|
||||||
|
|
||||||
if (LIBSSH2_FOUND)
|
|
||||||
set(LIBSSH2_INCLUDE_DIRS
|
|
||||||
${LIBSSH2_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(LIBSSH2_LIBRARIES
|
|
||||||
${LIBSSH2_LIBRARIES}
|
|
||||||
${LIBSSH2_LIBRARY}
|
|
||||||
)
|
|
||||||
endif (LIBSSH2_FOUND)
|
|
||||||
endif (LIBSSH2_LIBRARIES AND LIBSSH2_INCLUDE_DIRS)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user