mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:47:28 +03:00
cmake: fix confusing error when a dependency is undetected in curl-config.cmake
Fixing:
```
CMake Error at /path/to/CURL/CURLConfig.cmake:190 (get_target_property):
get_target_property() called with non-existent target "CURL::libssh2".
```
and replacing it with the clearer message:
```
CMake Error at /path/to/CURL/CURLTargets.cmake:61 (set_target_properties):
The link interface of target "CURL::libcurl_static" contains:
CURL::libssh2
but the target was not found. Possible reasons include:
[...]
```
Reported-by: Val S.
Ref: #20729
Follow-up to 16f073ef49 #16973
Closes #20737
This commit is contained in:
parent
c111275366
commit
fb58b23256
1 changed files with 5 additions and 3 deletions
|
|
@ -176,9 +176,11 @@ if(TARGET @PROJECT_NAME@::@LIB_STATIC@)
|
|||
if(NOT _has_CMP0099 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.13 AND _curl_libs)
|
||||
set(_curl_libdirs "")
|
||||
foreach(_curl_lib IN LISTS _curl_libs)
|
||||
get_target_property(_curl_libdir "${_curl_lib}" INTERFACE_LINK_DIRECTORIES)
|
||||
if(_curl_libdir)
|
||||
list(APPEND _curl_libdirs "${_curl_libdir}")
|
||||
if(TARGET "${_curl_lib}")
|
||||
get_target_property(_curl_libdir "${_curl_lib}" INTERFACE_LINK_DIRECTORIES)
|
||||
if(_curl_libdir)
|
||||
list(APPEND _curl_libdirs "${_curl_libdir}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
if(_curl_libdirs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue