summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-07-09 00:42:11 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-08 15:48:30 -0700
commit1f112c7738603269b47085d93c02d1a703b18618 (patch)
tree966089f62e6ea5bc72998b108d26eacfd8106223 /CMakeLists.txt
parenta558f09f8d3a074b313fa7a17e27473c8bb76e20 (diff)
downloadsubsurface-1f112c7738603269b47085d93c02d1a703b18618.tar.gz
Make the libssh linking optional
Due to bugs in libgit2, we force linking with libssh2 to add git-over-ssh support. On android we currency don't want libssh2 due to its dependency chain, so this makes the libssh2 force linking opt-out. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 12 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4eed8bed..a2e7dd5ac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,7 @@ option(NO_DOCS "disable the docs" OFF)
option(NO_PRINTING "disable the printing support" ON)
option(NO_USERMANUAL "don't include a viewer for the user manual" OFF)
option(USE_LIBGIT23_API "allow building with libgit2 master" OFF)
+option(FORCE_LIBSSH "force linking with libssh to workaround libgit2 bug" ON)
option(SUBSURFACE_MOBILE "build the QtQuick version for mobile device" OFF)
option(FBSUPPORT "allow posting to Facebook" ON)
@@ -54,8 +55,10 @@ if(LIBGIT2_FROM_PKGCONFIG)
if(USE_LIBGIT23_API)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_LIBGIT23_API")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LIBGIT23_API")
- pkg_config_library(LIBSSH2 libssh2 REQUIRED)
- set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
+ if(FORCE_LIBSSH)
+ pkg_config_library(LIBSSH2 libssh2 REQUIRED)
+ set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
+ endif()
endif()
else()
find_package(LIBGIT2 REQUIRED)
@@ -63,12 +66,14 @@ 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")
+ if(FORCE_LIBSSH)
find_package(Libssh2 QUIET CONFIG)
- if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1")
- set(LIBSSH2_LIBRARIES Libssh2::libssh2)
- endif()
- if(!LIBSSH2_FOUND OR "${LIBSSH2_FOUND}" STREQUAL "")
- pkg_config_library(LIBSSH2 libssh2 REQUIRED)
+ if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1")
+ set(LIBSSH2_LIBRARIES Libssh2::libssh2)
+ endif()
+ if(!LIBSSH2_FOUND OR "${LIBSSH2_FOUND}" STREQUAL "")
+ pkg_config_library(LIBSSH2 libssh2 REQUIRED)
+ endif()
endif()
find_package(libcurl QUIET)
if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "")