diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-05-28 09:13:51 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-28 09:13:51 -0700 |
commit | 95664af53bc6faf352cf5b193fe9dfd42fa25e60 (patch) | |
tree | c582c994b4af482e91ffcaa5871282be81775910 /CMakeLists.txt | |
parent | 8af85fbc043c06acf23b3a9408f20d54f00aab1b (diff) | |
download | subsurface-95664af53bc6faf352cf5b193fe9dfd42fa25e60.tar.gz |
Add USE_LIBGIT23_API as cmake option
Just as we would expect, the libgit2 developers of course once again broke
their API. In order to compile against current master we need to remap
those APIs once again.
Simply call cmake with -DUSE_LIBGIT23_API
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5247b623b..4f80fefeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ option(LIBDC_FROM_PKGCONFIG "use pkg-config to retrieve libdivecomputer" OFF) option(NO_MARBLE "disable the marble widget" OFF) option(NO_TESTS "disable the tests" OFF) option(NO_DOCS "disable the docs" OFF) +option(USE_LIBGIT23_API "allow building with libgit2 master" OFF) set(CMAKE_MODULE_PATH ${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules) include_directories(. ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} qt-ui qt-ui/profile) @@ -35,9 +36,18 @@ pkg_config_library(LIBUSB libusb-1.0 QUIET) 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") + 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(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -lssh2) + endif() endif() if(LIBDC_FROM_PKGCONFIG) |