CMake: in wx_get_dependencies, for existing targets, use its LOCATION instead of the target name

This commit is contained in:
NikitaFeodonit 2019-01-21 13:46:24 +03:00
parent 3510319048
commit 1bc43c8d7a

View File

@ -32,7 +32,12 @@ macro(wx_get_dependencies var lib)
if(TARGET ${lib})
get_target_property(deps ${lib} LINK_LIBRARIES)
foreach(dep IN LISTS deps)
get_filename_component(name ${dep} NAME)
if(TARGET ${dep})
get_target_property(dep_path ${dep} LOCATION)
else()
set(dep_path ${dep})
endif()
get_filename_component(name ${dep_path} NAME)
wx_string_append(${var} "${name} ")
endforeach()
string(STRIP ${${var}} ${var})