As i see from this question, libgit2
is now supporting use of ssh repository urls.
But how to force it to work? as i understood from CMakeLists file, SSH support will be enabled automatically if libssh2
library will be detected.
IF(NOT LIBSSH2_LIBRARY)
FIND_PACKAGE(LIBSSH2 QUIET)
ENDIF()
IF (LIBSSH2_FOUND)
MESSAGE("libssh2 was detected!")
ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
ENDIF()
As it has to be, i saw the "libssh2 was detected" message.
However, the macro GIT_SSH
after cmake work is still undefined, and all of SSH stuff is unavailable.
For example, code git_cred_ssh_keyfile_passphrase kf_pass;
does not compile.
I get such error:
'git_cred_ssh_keyfile_passphrase' was not declared in this scope
,
i.e. GIT_SSH
is undefined because this structure is declared in #ifdef GIT_SSH ... #endif
block.
Maybe i'm do something in a wrong way?