cmake: simplify `LINK_ONLY` imported target extraction
No binary (build failed)
—
(log yok)
| @@ -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() | |