45d2ff6f85
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 |
||
---|---|---|
.. | ||
Platforms | ||
CMakeConfigurableFile.in | ||
CurlSymbolHiding.cmake | ||
CurlTests.c | ||
FindBearSSL.cmake | ||
FindBrotli.cmake | ||
FindCARES.cmake | ||
FindGSS.cmake | ||
FindLibPSL.cmake | ||
FindLibSSH2.cmake | ||
FindMSH3.cmake | ||
FindMbedTLS.cmake | ||
FindNGHTTP2.cmake | ||
FindNGHTTP3.cmake | ||
FindNGTCP2.cmake | ||
FindQUICHE.cmake | ||
FindWolfSSL.cmake | ||
FindZstd.cmake | ||
Macros.cmake | ||
OtherTests.cmake | ||
PickyWarnings.cmake | ||
Utilities.cmake | ||
cmake_uninstall.cmake.in | ||
curl-config.cmake.in |