CMake: Add libraries of imported targets to wx-config

Use the LOCATION_DEBUG or LOCATION_RELEASE property of an imported target (like NanoSVG)
to determine the full library path.

Fixes #23373.

Closes #23390.
This commit is contained in:
Maarten Bent 2023-03-28 22:37:00 +02:00 committed by Vadim Zeitlin
parent e187667e6b
commit 8102958665

View file

@ -40,6 +40,15 @@ macro(wx_get_dependencies var lib)
else()
get_target_property(dep_name ${dep} OUTPUT_NAME)
endif()
if(NOT dep_name)
# imported target
set(prop_suffix)
if (CMAKE_BUILD_TYPE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" prop_suffix)
set(prop_suffix "_${prop_suffix}")
endif()
get_target_property(dep_name ${dep} LOCATION${prop_suffix})
endif()
else()
# For the value like $<$<CONFIG:DEBUG>:LIB_PATH>
# Or $<$<NOT:$<CONFIG:DEBUG>>:LIB_PATH>