mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
cmake: fix LOCATION property read errors in target debug function
Exclude reading certain props for certain target types to avoid these errors:
```
CMake Error at CMake/Utilities.cmake:71 (get_property):
The LOCATION property may not be read from target "...". Use the target
name directly with add_custom_command, or use the generator expression
$<TARGET_FILE>, as appropriate.
```
(and the same in line 78.)
Follow-up to 855acb3bb0 #17701
Closes #20828
This commit is contained in:
parent
37f5e3960f
commit
c6cfb2a2f3
@ -60,6 +60,10 @@ function(curl_dumptargetprops _target)
|
||||
list(REMOVE_DUPLICATES _cmake_property_list)
|
||||
list(REMOVE_ITEM _cmake_property_list "")
|
||||
list(APPEND _cmake_property_list "INTERFACE_LIBCURL_PC_MODULES")
|
||||
get_target_property(_target_type ${_target} TYPE)
|
||||
if(NOT _target_type MATCHES "(INTERFACE_LIBRARY|UNKNOWN_LIBRARY)")
|
||||
list(REMOVE_ITEM _cmake_property_list "LOCATION" "LOCATION_<CONFIG>" "MACOSX_PACKAGE_LOCATION" "VS_DEPLOYMENT_LOCATION")
|
||||
endif()
|
||||
foreach(_prop IN LISTS _cmake_property_list)
|
||||
if(_prop MATCHES "<CONFIG>")
|
||||
foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user