From 11268c94a64c3726f59e3eb3c811aa5af96b6919 Mon Sep 17 00:00:00 2001 From: Thomas Khyn Date: Fri, 25 Sep 2020 20:33:59 +1200 Subject: [PATCH] Allow cmake dependencies to be interfaces In some cases (see https://github.com/bincrafters/community/issues/1181), the dependencies can be library interfaces. As CMake's get_target_property is not tolerant about what properties can be extracted on different library types, it is necessary to make a distinction between interface libraries and plain libraries --- build/cmake/config.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 6978cc27254e..15dff884ea4a 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -33,7 +33,12 @@ macro(wx_get_dependencies var lib) get_target_property(deps wx${lib} LINK_LIBRARIES) foreach(dep IN LISTS deps) if(TARGET ${dep}) - get_target_property(dep_name ${dep} OUTPUT_NAME) + get_target_property(dep_type ${dep} TYPE) + if (dep_type STREQUAL "INTERFACE_LIBRARY") + get_target_property(dep_name ${dep} INTERFACE_OUTPUT_NAME) + else() + get_target_property(dep_name ${dep} OUTPUT_NAME) + endif() set(dep_name "-l${dep_name}") else() get_filename_component(dep_name ${dep} NAME)