Cmake: handle the case of local libgit2 but pkg_config for libssh2

Yes, it's kinda weird but that's what I happen to have on one of my
systems and this seems easy enough to implement.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-06-03 21:59:39 -07:00
parent 4805f3c995
commit 778204d662

View file

@ -59,7 +59,10 @@ else()
if(USE_LIBGIT23_API)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_LIBGIT23_API")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LIBGIT23_API")
find_package(libssh2 REQUIRED)
find_package(libssh2 QUIET)
if(!LIBSSH2_FOUND)
pkg_config_library(LIBSSH2 libssh2 REQUIRED)
endif()
set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
endif()
endif()