From c4c9df08270662d67acc691fead27196dc0d5b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 22 Jul 2023 20:39:19 +0200 Subject: [PATCH] modules: clean up Corrade dependency linking in FindMagnum. This is what's done in FindMagnumExtras, not sure why the variables weren't ever used here. --- modules/FindMagnum.cmake | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 3c29b149c..3fff91bcb 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -229,15 +229,13 @@ # Corrade library dependencies set(_MAGNUM_CORRADE_DEPENDENCIES ) foreach(_component ${Magnum_FIND_COMPONENTS}) - string(TOUPPER ${_component} _COMPONENT) - # Unrolling the transitive dependencies here so this doesn't need to be # after resolving inter-component dependencies. Listing also all plugins. if(_component MATCHES "^(Audio|DebugTools|MeshTools|Primitives|SceneTools|ShaderTools|Text|TextureTools|Trade|.+Importer|.+ImageConverter|.+Font|.+ShaderConverter)$") - set(_MAGNUM_${_COMPONENT}_CORRADE_DEPENDENCIES PluginManager) + set(_MAGNUM_${_component}_CORRADE_DEPENDENCIES PluginManager) endif() - list(APPEND _MAGNUM_CORRADE_DEPENDENCIES ${_MAGNUM_${_COMPONENT}_CORRADE_DEPENDENCIES}) + list(APPEND _MAGNUM_CORRADE_DEPENDENCIES ${_MAGNUM_${_component}_CORRADE_DEPENDENCIES}) endforeach() find_package(Corrade REQUIRED Utility ${_MAGNUM_CORRADE_DEPENDENCIES}) @@ -854,7 +852,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) elseif(_component STREQUAL Audio) find_package(OpenAL) set_property(TARGET Magnum::${_component} APPEND PROPERTY - INTERFACE_LINK_LIBRARIES Corrade::PluginManager OpenAL::OpenAL) + INTERFACE_LINK_LIBRARIES OpenAL::OpenAL) # No special setup for DebugTools library @@ -912,26 +910,15 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) elseif(_component STREQUAL SceneTools) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Hierarchy.h) - # ShaderTools library - elseif(_component STREQUAL ShaderTools) - set_property(TARGET Magnum::${_component} APPEND PROPERTY - INTERFACE_LINK_LIBRARIES Corrade::PluginManager) - + # No special setup for ShaderTools library # No special setup for Shaders library - - # Text library - elseif(_component STREQUAL Text) - set_property(TARGET Magnum::${_component} APPEND PROPERTY - INTERFACE_LINK_LIBRARIES Corrade::PluginManager) + # No special setup for Text library # TextureTools library elseif(_component STREQUAL TextureTools) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) - # Trade library - elseif(_component STREQUAL Trade) - set_property(TARGET Magnum::${_component} APPEND PROPERTY - INTERFACE_LINK_LIBRARIES Corrade::PluginManager) + # No special setup for Trade library # Vk library elseif(_component STREQUAL Vk) @@ -980,6 +967,10 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) # are optional dependencies, defer adding them to later once we know if # they were found or not. if(_component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS) + foreach(_dependency ${_MAGNUM_${_component}_CORRADE_DEPENDENCIES}) + set_property(TARGET Magnum::${_component} APPEND PROPERTY + INTERFACE_LINK_LIBRARIES Corrade::${_dependency}) + endforeach() set_property(TARGET Magnum::${_component} APPEND PROPERTY INTERFACE_LINK_LIBRARIES Magnum::Magnum) set(_MAGNUM_${component}_OPTIONAL_DEPENDENCIES_TO_ADD )