www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: CMake

Re: CMake

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Tue, 9 Dec 2014 00:45:53 +0000

On 8 December 2014 at 13:45, Kamil Dudka <kdudka_at_redhat.com> wrote:
> 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'.
...
>>
>> tl;dr
>> - A version of libssh2 using CMake is available at
>> https://github.com/alamaison/libssh2/tree/cmake
>> - Please test
>
> I got libssh2 successfully built for Fedora using CMake and your patchset:
>
> http://pkgs.fedoraproject.org/cgit/libssh2.git/commit/?id=213e752a
> http://koji.fedoraproject.org/koji/taskinfo?taskID=8321846

Thanks for testing :)

> 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 ""
> + SOVERSION 1
> + VERSION 1.0.1)
>
> target_compile_definitions(libssh2 PRIVATE ${PRIVATE_COMPILE_DEFINITIONS})
> target_include_directories(libssh2

I'll look into that tomorrow. IIRC they were always hardcoded, so
your patch might be a reasonable fix.

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

CMake has a feature [1] that allows it to be used in place of
pkg-config. In theory this removes the need for a .pc file, but, as
you can see from the comments, the feature isn't universally popular.
If you prefer, I can generate libssh2.pc from a template the way some
other projects do.

> - Man pages are not installed by CMake.

Fixed: https://github.com/alamaison/libssh2/commit/ce9c01d4621d5ae020f4386d390860e8c7aa553d

> - 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 libssh2.h.in and vice versa make the patchset difficult to apply on the
> latest upstream release.

I'll see what I can do to neaten it up.

[1] https://blogs.kde.org/2011/11/09/cool-new-stuff-cmake-286-2-pkg-config-compatible-mode-added-use-eg-autotools

Alex

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-12-09

the libssh2 team