@ -66,6 +66,8 @@ mark_as_advanced(MAGNUMBINDINGS_INCLUDE_DIR)
# C o m p o n e n t distinction ( listing them explicitly to avoid mistakes with finding
# C o m p o n e n t distinction ( listing them explicitly to avoid mistakes with finding
# c o m p o n e n t s f r o m o t h e r r e p o s i t o r i e s )
# c o m p o n e n t s f r o m o t h e r r e p o s i t o r i e s )
set ( _MAGNUMBINDINGS_HEADER_ONLY_COMPONENTS Python )
set ( _MAGNUMBINDINGS_HEADER_ONLY_COMPONENTS Python )
# N o t h i n g i s e n a b l e d b y d e f a u l t r i g h t n o w
set ( _MAGNUMBINDINGS_IMPLICITLY_ENABLED_COMPONENTS )
# N o i n t e r - c o m p o n e n t d e p e n d e n c i e s r i g h t n o w
# N o i n t e r - c o m p o n e n t d e p e n d e n c i e s r i g h t n o w
@ -83,6 +85,7 @@ foreach(_component ${MagnumBindings_FIND_COMPONENTS})
endforeach ( )
endforeach ( )
# J o i n t h e l i s t s , r e m o v e d u p l i c a t e c o m p o n e n t s
# J o i n t h e l i s t s , r e m o v e d u p l i c a t e c o m p o n e n t s
set ( _MAGNUMBINDINGS_ORIGINAL_FIND_COMPONENTS ${ MagnumBindings_FIND_COMPONENTS } )
if ( _MAGNUMBINDINGS_ADDITIONAL_COMPONENTS )
if ( _MAGNUMBINDINGS_ADDITIONAL_COMPONENTS )
list ( INSERT MagnumBindings_FIND_COMPONENTS 0 ${ _MAGNUMBINDINGS_ADDITIONAL_COMPONENTS } )
list ( INSERT MagnumBindings_FIND_COMPONENTS 0 ${ _MAGNUMBINDINGS_ADDITIONAL_COMPONENTS } )
endif ( )
endif ( )
@ -135,7 +138,41 @@ foreach(_component ${MagnumBindings_FIND_COMPONENTS})
endif ( )
endif ( )
endforeach ( )
endforeach ( )
# F o r C M a k e 3 . 1 6 + w i t h R E A S O N _ F A I L U R E _ M E S S A G E , p r o v i d e a d d i t i o n a l p o t e n t i a l l y
# u s e f u l i n f o a b o u t t h e f a i l e d c o m p o n e n t s .
if ( NOT CMAKE_VERSION VERSION_LESS 3.16 )
set ( _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE )
# G o o n l y t h r o u g h t h e o r i g i n a l l y s p e c i f i e d find_package ( ) c o m p o n e n t s , n o t
# t h e d e p e n d e n c i e s a d d e d b y u s a f t e r w a r d s
foreach ( _component ${ _MAGNUMBINDINGS_ORIGINAL_FIND_COMPONENTS } )
if ( MagnumBindings_ ${ _component } _FOUND )
continue ( )
endif ( )
# I f i t ' s n o t k n o w n a t a l l , t e l l t h e u s e r - - i t m i g h t b e a n e w l i b r a r y
# a n d a n o l d F i n d m o d u l e , o r s o m e t h i n g p l a t f o r m - s p e c i f i c .
if ( NOT _component IN_LIST _MAGNUMBINDINGS_LIBRARY_COMPONENTS AND NOT _component IN_LIST _MAGNUMBINDINGS_PLUGIN_COMPONENTS )
list ( APPEND _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE "${_component} is not a known component on this platform." )
# O t h e r w i s e , i f i t ' s n o t a m o n g i m p l i c i t l y b u i l t c o m p o n e n t s , h i n t t h a t
# t h e u s e r m a y n e e d t o e n a b l e i t
# T O D O : c u r r e n t l y , t h e _ F O U N D v a r i a b l e d o e s n ' t r e f l e c t i f d e p e n d e n c i e s
# w e r e f o u n d . W h e n i t w i l l , t h i s n e e d s t o b e u p d a t e d t o a v o i d
# m i s l e a d i n g m e s s a g e s .
elseif ( NOT _component IN_LIST _MAGNUMBINDINGS_IMPLICITLY_ENABLED_COMPONENTS )
string ( TOUPPER ${ _component } _COMPONENT )
list ( APPEND _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum Bindings" )
# O t h e r w i s e w e h a v e n o i d e a . B e t t e r b e s i l e n t t h a n t o p r i n t s o m e t h i n g
# m i s l e a d i n g .
else ( )
endif ( )
endforeach ( )
string ( REPLACE ";" " " _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE "${_MAGNUMBINDINGS_REASON_FAILURE_MESSAGE}" )
set ( _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE REASON_FAILURE_MESSAGE "${_MAGNUMBINDINGS_REASON_FAILURE_MESSAGE}" )
endif ( )
include ( FindPackageHandleStandardArgs )
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args ( MagnumBindings
find_package_handle_standard_args ( MagnumBindings
R E Q U I R E D _ V A R S M A G N U M B I N D I N G S _ I N C L U D E _ D I R
R E Q U I R E D _ V A R S M A G N U M B I N D I N G S _ I N C L U D E _ D I R
H A N D L E _ C O M P O N E N T S )
H A N D L E _ C O M P O N E N T S
$ { _ M A G N U M B I N D I N G S _ R E A S O N _ F A I L U R E _ M E S S A G E } )