mirror of
https://github.com/curl/curl.git
synced 2026-08-24 15:23:36 +03:00
cmake: simplify LINK_ONLY imported target extraction
Suggested-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/21654#discussion_r3425296606
Follow-up to 3c597ced16 #21654
Closes #22063
This commit is contained in:
parent
e8b76773af
commit
174cafb3e6
1 changed files with 2 additions and 4 deletions
|
|
@ -267,10 +267,8 @@ macro(curl_collect_target_link_options _target)
|
|||
get_target_property(_val ${_target} INTERFACE_LINK_LIBRARIES)
|
||||
if(_val)
|
||||
foreach(_lib IN LISTS _val)
|
||||
# E.g. via libssh2: "$<LINK_ONLY:OpenSSL::Crypto>"
|
||||
if(_lib MATCHES "LINK_ONLY:")
|
||||
string(REGEX MATCH "([A-Za-z0-9_-]+::[A-Za-z0-9_-]+)" _lib "${_lib}") # Extract imported target name
|
||||
endif()
|
||||
# Extract imported target name from e.g. "$<LINK_ONLY:OpenSSL::Crypto>" set by libssh2
|
||||
string(REGEX REPLACE "^\\\$<LINK_ONLY:(.*)>\$" "\\1" _lib "${_lib}")
|
||||
if(TARGET "${_lib}")
|
||||
curl_collect_target_link_options(${_lib})
|
||||
else()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue