libssh 0.9.1 no longer defines LIBSSH_LIBRARIES in its cmake config, and exports a ssh_shared target instead.
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.
This means the right code would be then.
if (TARGET ssh) # libssh 0.9+ target_link_libraries(kio_sftp ssh) endif()