curl/CMake
Kai Pastor 45d2ff6f85
cmake: fix multiple include of CURL package
Fixes errors on second `find_package(CURL)`. This is a frequent case
with transitive dependencies:
```
CMake Error at ...:
  add_library cannot create ALIAS target "CURL::libcurl" because another
  target with the same name already exists.
```

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

project(curl)

set(CURL_DIR "example/lib/cmake/CURL/")
find_package(CURL CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)  # fails

add_executable(main main.c)
target_link_libraries(main CURL::libcurl)
```

Ref: https://cmake.org/cmake/help/latest/release/3.18.html#other-changes
Ref: https://cmake.org/cmake/help/v3.18/policy/CMP0107.html
Ref: #12300
Assisted-by: Harry Mallon
Closes #11913
2023-11-10 18:23:22 +00:00
..
Platforms build: delete `HAVE_STDINT_H` and `HAVE_INTTYPES_H` 2023-11-06 17:20:39 +00:00
CMakeConfigurableFile.in
CurlSymbolHiding.cmake cmake: lib `CURL_STATICLIB` fixes (Windows) 2023-09-25 22:05:29 +00:00
CurlTests.c build: variadic macro tidy-ups 2023-10-27 00:37:34 +00:00
FindBearSSL.cmake
FindBrotli.cmake
FindCARES.cmake
FindGSS.cmake
FindLibPSL.cmake
FindLibSSH2.cmake
FindMSH3.cmake
FindMbedTLS.cmake
FindNGHTTP2.cmake
FindNGHTTP3.cmake
FindNGTCP2.cmake h3: add support for ngtcp2 with AWS-LC builds 2023-10-08 22:35:04 +00:00
FindQUICHE.cmake
FindWolfSSL.cmake
FindZstd.cmake cmake: speed up zstd detection 2023-10-27 00:37:34 +00:00
Macros.cmake cmake: replace `check_library_exists_concat()` 2023-10-15 20:48:17 +00:00
OtherTests.cmake cmake: pre-fill rest of detection values for Windows 2023-10-24 21:06:36 +00:00
PickyWarnings.cmake
Utilities.cmake
cmake_uninstall.cmake.in
curl-config.cmake.in cmake: fix multiple include of CURL package 2023-11-10 18:23:22 +00:00