1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-18 15:20:56 +03:00
Files
libssh2/tests
Viktor Szakats 932d6a3277 cmake: fix multiple include of libssh2 package
Also extend our integration test double inclusion. It will still not
catch this case, because that requires
`cmake_minimum_required(VERSION 3.18)` or higher.

Fixes:
```
CMake Error at .../lib/cmake/libssh2/libssh2-config.cmake:8 (add_library):
  add_library cannot create ALIAS target "libssh2::libssh2" because another
  target with the same name already exists.
Call Stack (most recent call first):
  CMakeLists.txt:24 (find_package)

CMake Error at .../lib/cmake/libssh2/libssh2-config.cmake:13 (add_library):
  add_library cannot create ALIAS target "Libssh2::libssh2" because another
  target with the same name already exists.
Call Stack (most recent call first):
  CMakeLists.txt:24 (find_package)
```

Test to reproduce:
```cmake
cmake_minimum_required(VERSION 3.18)  # must be 3.18 or higher

project(test)

find_package(libssh2 CONFIG)
find_package(libssh2 CONFIG)  # fails

add_executable(test main.c)
target_link_libraries(test libssh2::libssh2)
```

Ref: https://cmake.org/cmake/help/latest/release/3.18.html#other-changes
Ref: https://cmake.org/cmake/help/v3.18/policy/CMP0107.html

Assisted-by: Kai Pastor
Assisted-by: Harry Mallon
Ref: https://github.com/curl/curl/pull/11913

Closes #1216
2023-11-09 22:38:07 +00:00
..
2023-11-06 15:00:08 +00:00
2023-08-28 22:57:02 +00:00
2023-08-03 01:12:21 +00:00
2016-08-14 16:03:25 +01:00
2016-08-14 16:03:25 +01:00
2016-08-14 16:03:25 +01:00
2016-08-14 16:03:25 +01:00
2023-04-24 21:28:28 +00:00
2023-04-24 21:28:28 +00:00
2016-08-14 16:03:25 +01:00
2018-08-02 14:00:25 -07:00
2016-08-14 16:03:25 +01:00
2023-06-07 08:18:55 +02:00
2023-06-21 12:50:26 +00: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-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-06-21 12:50:26 +00:00