Subject: Re: CMake

Re: CMake

From: Kamil Dudka <>
Date: Mon, 08 Dec 2014 14:45:33 +0100

On Saturday 06 December 2014 00:34:41 Alexander Lamaison wrote:
> You may recall that back in March I promised to convert the libssh2
> build system to CMake 'soon'. Well, 9 months later, it is more or
> less complete: I
> would greatly appreciate your feedback and help with testing on the
> platforms that matter to you.
> The goal is to match or exceed every relevant feature of the autotools
> system like-for-like, so, unless otherwise stated in this email,
> assume that any missing functionality is a bug. Please report it.
> CMake, however, is fundamentally different from autotools, so some
> features (for example, building source distributions, aka `make dist`)
> aren't relevant anymore and aren't specifically catered for. The
> README should get you started but, if you need help getting accustomed
> to CMake, I'm very happy to answer any questions you have.
> tl;dr
> - A version of libssh2 using CMake is available at
> - Please test

Thank you for working on this!

I got libssh2 successfully built for Fedora using CMake and your patchset:

I have encountered a few minor issues:

- The shared library is no longer versioned as it used to be. I have
hard-coded the version into src/CMakeLists.txt for now:

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -186,7 +186,9 @@ endif()

 add_library(libssh2 ${SOURCES})
 # we want it to be called libssh2 on all platforms
-set_target_properties(libssh2 PROPERTIES PREFIX "")
+set_target_properties(libssh2 PROPERTIES PREFIX ""
+ VERSION 1.0.1)

 target_compile_definitions(libssh2 PRIVATE ${PRIVATE_COMPILE_DEFINITIONS})

- The file libssh2.pc is no longer generated with CMake. Is there any plan
to restore this functionality?

- Man pages are not installed by CMake.

- Before it goes to master, it would be good to merge some commits to make
the history easier to follow. Namely the unnecessary renames of libssh2.h
to and vice versa make the patchset difficult to apply on the
latest upstream release.

Received on 2014-12-08