summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-06-04 00:10:40 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-03 21:39:26 -0700
commit537dcb15e093a32f0588f3e4059a4d23e86f9bae (patch)
tree11d1745b7c77e0361ed7fe0c8eb48b3a28fd3f2f /CMakeLists.txt
parent09ca240c3ee41f8d8fb029873d63e301da37fc99 (diff)
downloadsubsurface-537dcb15e093a32f0588f3e4059a4d23e86f9bae.tar.gz
Use CMake to find libssh2
This works on my system, I hope I don't break others. Another possibility is to pass -libssh2 directly if it's NOTFOUND. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93d5262d2..5faee5291 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,12 @@ 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)
+set(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ ${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules
+ ${${PROJECT_NAME}_SOURCE_SIR}/../install-root/lib/cmake/libssh2
+)
+
include_directories(.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
@@ -54,7 +59,8 @@ 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")
- set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -lssh2)
+ find_package(libssh2 REQUIRED)
+ set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
endif()
endif()