diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 24699091a..0a8eea56a 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -314,6 +314,13 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCIES Text TextureTools) endif() + # Mark the dependencies as required if the component is also required + if(Magnum_FIND_REQUIRED_${_component}) + foreach(_dependency ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) + set(Magnum_FIND_REQUIRED_${_dependency} TRUE) + endforeach() + endif() + list(APPEND _MAGNUM_ADDITIONAL_COMPONENTS ${_MAGNUM_${_COMPONENT}_DEPENDENCIES}) endforeach()