@ -323,6 +323,30 @@ if(MAGNUM_BUILD_DEPRECATED)
endif ( )
endif ( )
# C M a k e m o d u l e d i r f o r d e p e n d e n c i e s . I t m i g h t n o t b e p r e s e n t a t a l l i f n o
# f e a t u r e t h a t n e e d s t h e m i s e n a b l e d , i n w h i c h c a s e i t ' l l b e l e f t a t N O T F O U N D .
# B u t i n t h a t c a s e i t s h o u l d a l s o n o t b e s u b s e q u e n t l y n e e d e d f o r a n y
# find_package ( ) . I f t h i s i s c a l l e d f r o m a s u p e r p r o j e c t , t h e
# _ M A G N U M _ D E P E N D E N C Y _ M O D U L E _ D I R i s a l r e a d y s e t b y m o d u l e s / C M a k e L i s t s . t x t .
find_path ( _MAGNUM_DEPENDENCY_MODULE_DIR
N A M E S
F i n d E G L . c m a k e F i n d G L F W . c m a k e F i n d O p e n A L . c m a k e F i n d O p e n G L E S 2 . c m a k e
F i n d O p e n G L E S 3 . c m a k e F i n d S D L 2 . c m a k e F i n d V u l k a n . c m a k e
P A T H _ S U F F I X E S s h a r e / c m a k e / M a g n u m / d e p e n d e n c i e s )
mark_as_advanced ( _MAGNUM_DEPENDENCY_MODULE_DIR )
# I f t h e m o d u l e d i r i s f o u n d a n d i s n o t p r e s e n t i n C M A K E _ M O D U L E _ P A T H a l r e a d y
# ( s u c h a s w h e n s o m e o n e e x p l i c i t l y a d d e d i t , o r i f i t ' s t h e M a g n u m ' s m o d u l e s /
# d i r i n c a s e o f a s u p e r p r o j e c t ) , a d d i t a s t h e f i r s t b e f o r e a l l o t h e r . S e t a
# f l a g t o r e m o v e i t a g a i n a t t h e e n d , s o t h e m o d u l e s d o n ' t c l a s h w i t h F i n d
# m o d u l e s o f t h e s a m e n a m e f r o m o t h e r p r o j e c t s .
if ( _MAGNUM_DEPENDENCY_MODULE_DIR AND NOT _MAGNUM_DEPENDENCY_MODULE_DIR IN_LIST CMAKE_MODULE_PATH )
set ( CMAKE_MODULE_PATH ${ _MAGNUM_DEPENDENCY_MODULE_DIR } ${ CMAKE_MODULE_PATH } )
set ( _MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH ON )
else ( )
unset ( _MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH )
endif ( )
# B a s e M a g n u m l i b r a r y
if ( NOT TARGET Magnum::Magnum )
add_library ( Magnum::Magnum UNKNOWN IMPORTED )
@ -710,6 +734,9 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# D e c i d e i f t h e l i b r a r y w a s f o u n d . I f n o t , s k i p t h e r e s t , w h i c h
# p o p u l a t e s t h e t a r g e t p r o p e r t i e s a n d f i n d s a d d i t i o n a l d e p e n d e n c i e s .
# T h i s m e a n s t h a t t h e r e s t c a n a l s o r e l y o n t h a t e . g . F i n d E G L . c m a k e i s
# p r e s e n t i n _ M A G N U M _ D E P E N D E N C Y _ M O D U L E _ D I R - - g i v e n t h a t t h e l i b r a r y
# n e e d i n g E G L w a s f o u n d , i t l i k e l y a l s o i n s t a l l e d F i n d E G L f o r i t s e l f .
if ( ( ( _component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS ) AND _MAGNUM_ ${ _COMPONENT } _INCLUDE_DIR AND ( MAGNUM_ ${ _COMPONENT } _LIBRARY_DEBUG OR MAGNUM_ ${ _COMPONENT } _LIBRARY_RELEASE ) ) OR ( _component IN_LIST _MAGNUM_EXECUTABLE_COMPONENTS AND MAGNUM_ ${ _COMPONENT } _EXECUTABLE ) )
set ( Magnum_ ${ _component } _FOUND TRUE )
else ( )
@ -1112,6 +1139,13 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
set ( _MAGNUM_REASON_FAILURE_MESSAGE REASON_FAILURE_MESSAGE "${_MAGNUM_REASON_FAILURE_MESSAGE}" )
endif ( )
# R e m o v e M a g n u m ' s d e p e n d e n c y m o d u l e d i r f r o m C M A K E _ M O D U L E _ P A T H a g a i n . D o i t
# b e f o r e t h e F P H S A c a l l w h i c h m a y e x i t e a r l y i n c a s e o f a f a i l u r e .
if ( _MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH )
list ( REMOVE_ITEM CMAKE_MODULE_PATH ${ _MAGNUM_DEPENDENCY_MODULE_DIR } )
unset ( _MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH )
endif ( )
# C o m p l e t e t h e c h e c k w i t h a l s o a l l c o m p o n e n t s
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args ( Magnum