Commit d10de8bd by Carlos Martín Nieto

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.
parent 7affc2f7
...@@ -148,15 +148,14 @@ ELSE() ...@@ -148,15 +148,14 @@ ELSE()
FILE(GLOB SRC_ZLIB deps/zlib/*.c deps/zlib/*.h) FILE(GLOB SRC_ZLIB deps/zlib/*.c deps/zlib/*.h)
ENDIF() ENDIF()
IF(NOT LIBSSH2_LIBRARY) FIND_PACKAGE(LIBSSH2 QUIET)
FIND_PACKAGE(LIBSSH2 QUIET)
ENDIF()
IF (LIBSSH2_FOUND) IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH) ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES}) SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
ENDIF() ENDIF()
# Platform specific compilation flags # Platform specific compilation flags
IF (MSVC) IF (MSVC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment