So trying to CMake libgit on windows, ive build a valid libssh2 but I'm getting this error when compiling libgit
- checking for module 'libssh2'
- package 'libssh2' not found
- LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
- Configuring done
now ive tried setting the default prefix path and ive tried setting library paths but I just cant get it to see my libssh2? any ideas?
its getting quite frustrating as I have it right here and it cant find it :D
maybe someone could tell me the correct path it should be installed?
Kind regards Rob
****************Update 1****************
so i pulled out of the make file this....seems to have changed but as far as i can see PKG_CHECK_MODULES(LIBSSH2 libssh2) is the check, maybe it doesnt set LIBSSH2_FOUND?
# Optional external dependency: libssh2
IF (USE_SSH)
PKG_CHECK_MODULES(LIBSSH2 libssh2)
ENDIF()
IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS})
LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
#SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${LIBSSH2_LDFLAGS}")
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS)
ADD_DEFINITIONS(-DGIT_SSH_MEMORY_CREDENTIALS)
ENDIF()
ELSE()
MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
ENDIF()
ive tried setting LIBSSH2_INCLUDE_DIRS /LIBSSH2_INCLUDE_DIR and LIBSSH2_LIBRARIES to no avail?
****************Update 2****************
So as per sugested its searching for the .pc file. well i found it....pointed it directly at it and it still couldnt find it? i even pointed it several directories up from it. the paths in the pc file seem to match the locations i would expect.? is this make file just completly borked?
checking for module 'libssh2'
package 'libssh2' not found
LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
****************Update 3****************
So update 3 i installed a binary of openssl on windows, further download libssh2-master and used cmake gui to build a visual studio solution which had no errors, the solution compiled and built. I made an install and package from the solution and installed in the suggested default location, i also took the header files, and library files and put them in my vc folder, and once i tried building the shared lib and put the dll in system32 etc so ive tried quite a lot :) libgit still cant find it Hope thats a bit more info
****************Update 4****************
So fixed it in the end... i went back through the git history and blamed the make file. found someone originally wrote it with FIND_PACKAGE but changed it to suit their own needs.
so i changed it back and used the below. no longer complains and finds what it needs and compiles and works. so yay thanks for your help
IF (USE_SSH)
FIND_PACKAGE(LIBSSH2)
ENDIF()
IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS})
LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} libssh2")
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
ADD_DEFINITIONS(-DGIT_SSH_MEMORY_CREDENTIALS)
ENDIF()