[cmake-developers] Help enabling libssh2 in cmake

Jameson Merkow jmerkow at gmail.com
Wed Oct 29 16:27:09 EDT 2014


Hello,

I am working on adding libssh2 support into cmake (specifically the curl
code). Most of the ground work was previously done so most of what I had to
use was add cmake support. I'm having some issues still.

So, I've added the option for libssh2, its find_package call, and defined
the options in Utilities/cmcurl/config.h.in for libssh2.

When try a simple test (cmake -P)
file(WRITE  upload.txt "testing upload")
file(UPLOAD upload.txt "sftp://username:pw@url:path/to/home/" STATUS status
SHOW_PROGRESS)
message(STATUS "STATUS ${status}")

I get:
-- STATUS 6;"couldn't resolve host name"
or (If I drop the path):
-- STATUS 2;"failed init"

I cannot be sure if this is a parsing problem or some other problem.  Using
--debug-output doesn't give me anything additional and I don't know where
this error is being thrown.  Is there an easy way to get more info than
this?  I've tried adding some printfs to print the hostname, but they don't
seem to be displayed (or maybe I haven't found the correct location of
where its thrown).


The only non cmake change I made was a function name change for
libssh2_free to libssh2_free2 in ssh.c. The current code defines this
function for the LIBSSH2_FREE_FUNC callback but this function is already
defined in libssh2.h (I am using version 1.4.3).  I renamed this function
in the cmake code to libssh2_free2 so the symbols would not clash.
Anyway, I attached the git patch so people can take a look. There may be a
few debug messages in there which would be removed before submission.

-Jameson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141029/dd2e9660/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use_libssh2.patch
Type: text/x-patch
Size: 5381 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141029/dd2e9660/attachment-0001.bin>


More information about the cmake-developers mailing list