1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-27 00:18:12 +03:00
Viktor Szakats a8dd5090d6 cmake: avoid 'target is imported but not globally visible' when consuming libcurl with old cmake
Fixes:
```
CMake Error at bld-libssh2/_pkg/lib/cmake/libssh2/libssh2-config.cmake:35 (add_library):
  add_library cannot create ALIAS target "libssh2::libssh2" because target
  "libssh2::libssh2_shared" is imported but not globally visible.
Call Stack (most recent call first):
  CMakeLists.txt:27 (find_package)

CMake Error at bld-libssh2/_pkg/lib/cmake/libssh2/libssh2-config.cmake:40 (add_library):
  add_library cannot create ALIAS target "Libssh2::libssh2" because target
  "libssh2::libssh2_shared" is imported but not globally visible.
Call Stack (most recent call first):
  CMakeLists.txt:27 (find_package)
```

tests/cmake reproducer (requires #1581):
```shell
export CMAKE_CONSUMER=/path/to/CMake-3.12.0/bin/cmake
./test.sh find_package
```

I don't understand what this error says, why it happens in certain CMake
versions, and why a workaround is necessary for what seems like
a standard export/consume configuration. This patch is based on internet
suggestions and other projects ending up with this workaround.

Ref: https://github.com/curl/curl/pull/16973
Ref: https://github.com/curl/curl/pull/17140
Cherry-picked from #1581
Closes #1587
2025-04-25 16:44:55 +02:00
2025-04-25 14:59:59 +02:00
2025-03-24 14:04:07 +01:00
2023-06-07 08:18:55 +02:00
2025-04-10 08:59:47 +02:00
2019-08-02 16:38:08 -07:00
2025-01-31 02:00:28 +01:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-06-07 08:18:55 +02:00
2023-08-18 11:20:58 +00:00
2024-10-02 16:04:30 +02:00
2011-04-04 13:31:33 +02:00
2023-08-18 11:20:58 +00:00
2023-08-18 11:20:58 +00:00
2024-10-16 10:03:11 +02:00

libssh2 - SSH2 library

libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.

Web site

Mailing list

BSD Licensed

Web site source code

Installation instructions:

Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Readme 18 MiB
Languages
C 84.8%
M4 3.6%
CMake 3.5%
Shell 2.6%
Perl 1.9%
Other 3.3%