summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-03 21:59:39 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-03 22:15:26 -0700
commit778204d662a2e01b2effb4a8653c2c9d06d2ccbe (patch)
tree3198663ac7baf7674e2766397d9b8b38d4b171ea /CMakeLists.txt
parent4805f3c995829db20043d53b301cdbf62617ca98 (diff)
downloadsubsurface-778204d662a2e01b2effb4a8653c2c9d06d2ccbe.tar.gz
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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5faee5291..e35090807 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()