libssh 0.9.1 no longer defines LIBSSH_LIBRARIES in its cmake config, and exports a ssh_shared target instead.
Diff Detail
- Repository
- R320 KIO Extras
- Lint
Lint Skipped - Unit
Unit Tests Skipped
I think there's a smarter way of dealing with this somewhere in our finder, not blocking though. I'll take a look when I find a minute.
@asn it seems to me the cmake config broke compat between 0.9.0 and 0.9.1 :|
We moved from a manually generated libssh-config.cmake to install(EXPORTS libssh-config) and it does things completely different.
I'm currently trying to fix it. However better don't apply this as ssh_shared will vanish as a target.
I wonder how I can define LIBSSH_LIBRARIES again with EXPORTS.
I am not super certain, but I don't think you can as that is pretty much exactly where configure_package_config_file would be used. We certainly do use it that way all over KDE frameworks.
Btw about the ssh_shared target. It may make sense to settle on a target name and use that moving forward and advertise it as the recommended way of using libssh. IMPORTED targets are vastly preferred over the _LIBRARES/_INCLUDE_DIRS variables from a cmake POV because the targets can inject include dirs, flags and the likes without the library user having to worry about anything. So they are nicer to use in cmake. Just something to think about perhaps.
The plan is to have ssh as the target name and nothing else and support BUILD_SHARED_LIBS.
The libssh maintainer is likely reverting the change, so this should not be necessary.
I've created https://gitlab.com/libssh/libssh-mirror/merge_requests/71
This means the right code would be then.
if (TARGET ssh) # libssh 0.9+ target_link_libraries(kio_sftp ssh) endif()