summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-12 12:07:33 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-12 12:07:33 +0200
commitd10de8bd8dff0ebbb7d6684f5a7b9d3e1ec04667 (patch)
tree3518d819bbfb683c1b9359d8442788cbefe2b5a6
parent7affc2f7dec48dc886e9838b102bdd42d06b1d2d (diff)
downloadlibgit2-d10de8bd8dff0ebbb7d6684f5a7b9d3e1ec04667.tar.gz
CMake: finding libssh2 should be idempotent
With the current code, running 'cmake .' in an already-configured directory causes the removal of ssh flags passed to the compiler, making it impossible to build with ssh support but by removing CMake's cache. Remove the check for LIBSSH2_LIBRARY and let CMake do the right thing wrt finding the library.
-rw-r--r--CMakeLists.txt5
1 files changed, 2 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53f568ed3..1500a3a68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,15 +148,14 @@ ELSE()
FILE(GLOB SRC_ZLIB deps/zlib/*.c deps/zlib/*.h)
ENDIF()
-IF(NOT LIBSSH2_LIBRARY)
- FIND_PACKAGE(LIBSSH2 QUIET)
-ENDIF()
+FIND_PACKAGE(LIBSSH2 QUIET)
IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
ENDIF()
+
# Platform specific compilation flags
IF (MSVC)