Skip to content

cmake: imported target Libssh2::libssh2 disappeared #1103

@rbrich

Description

@rbrich

Describe the bug
In 1.11.0, there is now only Libssh2::libssh2_static or Libssh2::libssh2_shared.
The Libssh2::libssh2 which worked with 1.10.0 is no longer there.

To Reproduce
Build and install libssh2, use cmake config to import libssh2 into another CMake project

find_package(Libssh2 REQUIRED)
target_link_libraries(some_target PRIVATE Libssh2::libssh2)

-> CMake error, Libssh2::libssh2 doesn't exist

Works only with Libssh2::libssh2_static.

Expected behavior
Libssh2::libssh2 exists as alias to either static or shared, depending on what kind of libssh2 was built.

Version (please complete the following information):

  • OS and version: macOS
  • libssh2 version: 1.11.0
  • crypto backend and version: OpenSSL

Additional context
As there is already a breaking change, maybe reconsider #731.
You can also add another alias for compatibility, e.g.:

add_library(libssh2::libssh2 ALIAS ${LIB_SELECTED})
add_library(Libssh2::libssh2 ALIAS ${LIB_SELECTED})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions