diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-12-14 22:34:15 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-15 13:33:00 -0800 |
commit | 7aab63558525a8c6e17d39bdc4e3691baa02266e (patch) | |
tree | 5f875366977b81df358e258844eac3d7c579d0f7 /CMakeLists.txt | |
parent | c8be04edad5e5f8cc91bae22d599ffdda1042376 (diff) | |
download | subsurface-7aab63558525a8c6e17d39bdc4e3691baa02266e.tar.gz |
Remove support for older libgit2 - we now require 0.23 or later
Also fixes a capitalization error that prevented finding libssh2 in some
circumstances. And adds a missing include when building with libzip on Mac.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a566204d..9e278427e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,6 @@ option(NO_MARBLE "disable the marble widget" OFF) option(NO_DOCS "disable the docs" OFF) option(NO_PRINTING "disable the printing support" OFF) 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) @@ -89,40 +88,37 @@ endif() if(LIBGIT2_FROM_PKGCONFIG) pkg_config_library(LIBGIT2 libgit2 REQUIRED) set(LIBGIT2_LIBRARIES "") - 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(ANDROID) - # for Android we need to force a static link against ssl and crypto - # this is a bit hacky, but it seems to work - set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBGIT2_LIBRARY_DIRS}/libssl.a ${LIBGIT2_LIBRARY_DIRS}/libcrypto.a) - endif() - if(FORCE_LIBSSH) - pkg_config_library(LIBSSH2 libssh2 REQUIRED) - set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES}) - endif() + if(ANDROID) + # for Android we need to force a static link against ssl and crypto + # this is a bit hacky, but it seems to work + set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBGIT2_LIBRARY_DIRS}/libssl.a ${LIBGIT2_LIBRARY_DIRS}/libcrypto.a) + endif() + if(FORCE_LIBSSH) + pkg_config_library(LIBSSH2 libssh2 REQUIRED) + set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES}) endif() else() find_package(LIBGIT2 REQUIRED) include_directories(${LIBGIT2_INCLUDE_DIR}) - 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) - endif() + if(FORCE_LIBSSH) + find_package(Libssh2 QUIET CONFIG) + find_package(Libssh2 REQUIRED) + if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1") + set(LIBSSH2_LIBRARIES Libssh2::libssh2) endif() - find_package(libcurl QUIET) - if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "") - pkg_config_library(LIBCURL libcurl REQUIRED) + get_cmake_property(_variableNames VARIABLES) + foreach (_variableName ${_variableNames}) + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() + if(!Libssh2_FOUND OR "${Libssh2_FOUND}" STREQUAL "") + pkg_config_library(LIBSSH2 libssh2 REQUIRED) endif() - set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES}) endif() + find_package(libcurl QUIET) + if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "") + pkg_config_library(LIBCURL libcurl REQUIRED) + endif() + set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES}) endif() if(LIBDC_FROM_PKGCONFIG) @@ -311,6 +307,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.subsurface-divelog") set(MACOSX_BUNDLE_BUNDLE_NAME "Subsurface") endif() + + # on the Mac with Homebrew, libzip ends up with odd include dirs + include_directories(${LIBZIP_INCLUDE_DIRS}) + find_library(APP_SERVICES_LIBRARY ApplicationServices) find_library(HID_LIB HidApi) set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${HID_LIB}) |