0

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?

Community
  • 1
  • 1
eraxillan
  • 1,552
  • 1
  • 19
  • 40
  • 1
    What exact error are you getting? How have you determined that `GIT_SSH` isn't being defined? – Carlos Martín Nieto May 28 '13 at 15:31
  • @CarlosMartínNieto The error is `'git_cred_ssh_keyfile_passphrase' was not declared in this scope`. This structure is declared in `#ifdef GIT_SSH` block in libgit2. So, i'm sure this macro is undefined. But it shouldn't be! – eraxillan May 29 '13 at 03:25
  • Make sure you clean your build directory. I could only reproduce any issue when working from a dirty build dir from before the option made it into the dev branch. – Carlos Martín Nieto Jun 01 '13 at 13:19
  • @CarlosMartínNieto I'm just convert `libgit2` make system from `cmake` to Qt's `qmake` because this library is using in large Qt/qmake project. So, my question became "deprecated", heh. But thanks for tip. – eraxillan Jun 04 '13 at 11:07

0 Answers0