Browse Source

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.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
c4c9df0827
  1. 29
      modules/FindMagnum.cmake

29
modules/FindMagnum.cmake

@ -229,15 +229,13 @@
# Corrade library dependencies # Corrade library dependencies
set(_MAGNUM_CORRADE_DEPENDENCIES ) set(_MAGNUM_CORRADE_DEPENDENCIES )
foreach(_component ${Magnum_FIND_COMPONENTS}) foreach(_component ${Magnum_FIND_COMPONENTS})
string(TOUPPER ${_component} _COMPONENT)
# Unrolling the transitive dependencies here so this doesn't need to be # Unrolling the transitive dependencies here so this doesn't need to be
# after resolving inter-component dependencies. Listing also all plugins. # 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)$") 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() endif()
list(APPEND _MAGNUM_CORRADE_DEPENDENCIES ${_MAGNUM_${_COMPONENT}_CORRADE_DEPENDENCIES}) list(APPEND _MAGNUM_CORRADE_DEPENDENCIES ${_MAGNUM_${_component}_CORRADE_DEPENDENCIES})
endforeach() endforeach()
find_package(Corrade REQUIRED Utility ${_MAGNUM_CORRADE_DEPENDENCIES}) find_package(Corrade REQUIRED Utility ${_MAGNUM_CORRADE_DEPENDENCIES})
@ -854,7 +852,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
elseif(_component STREQUAL Audio) elseif(_component STREQUAL Audio)
find_package(OpenAL) find_package(OpenAL)
set_property(TARGET Magnum::${_component} APPEND PROPERTY 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 # No special setup for DebugTools library
@ -912,26 +910,15 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
elseif(_component STREQUAL SceneTools) elseif(_component STREQUAL SceneTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Hierarchy.h) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Hierarchy.h)
# ShaderTools library # No special setup for ShaderTools library
elseif(_component STREQUAL ShaderTools)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::PluginManager)
# No special setup for Shaders library # No special setup for Shaders library
# No special setup for Text library
# Text library
elseif(_component STREQUAL Text)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::PluginManager)
# TextureTools library # TextureTools library
elseif(_component STREQUAL TextureTools) elseif(_component STREQUAL TextureTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h)
# Trade library # No special setup for Trade library
elseif(_component STREQUAL Trade)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::PluginManager)
# Vk library # Vk library
elseif(_component STREQUAL Vk) 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 # are optional dependencies, defer adding them to later once we know if
# they were found or not. # they were found or not.
if(_component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS) 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 set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Magnum::Magnum) INTERFACE_LINK_LIBRARIES Magnum::Magnum)
set(_MAGNUM_${component}_OPTIONAL_DEPENDENCIES_TO_ADD ) set(_MAGNUM_${component}_OPTIONAL_DEPENDENCIES_TO_ADD )

Loading…
Cancel
Save