Skip to content

Commit

Permalink
Allow cmake dependencies to be interfaces
Browse files Browse the repository at this point in the history
In some cases (see bincrafters/community#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
  • Loading branch information
tkhyn committed Sep 25, 2020
1 parent 1f3150b commit 11268c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 11268c9

Please sign in to comment.