@ -356,20 +356,50 @@ endif()
# 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 ( _MAGNUM_LIBRARY_COMPONENTS
A u d i o D e b u g T o o l s G L M e s h T o o l s P r i m i t i v e s S c e n e G r a p h S h a d e r s S h a d e r T o o l s
T e x t T e x t u r e T o o l s T r a d e V k
A n d r o i d A p p l i c a t i o n E m s c r i p t e n A p p l i c a t i o n G l f w A p p l i c a t i o n G l x A p p l i c a t i o n
S d l 2 A p p l i c a t i o n X E g l A p p l i c a t i o n W i n d o w l e s s C g l A p p l i c a t i o n
W i n d o w l e s s E g l A p p l i c a t i o n W i n d o w l e s s G l x A p p l i c a t i o n W i n d o w l e s s I o s A p p l i c a t i o n
W i n d o w l e s s W g l A p p l i c a t i o n W i n d o w l e s s W i n d o w s E g l A p p l i c a t i o n
C g l C o n t e x t E g l C o n t e x t G l x C o n t e x t W g l C o n t e x t
O p e n G L T e s t e r )
T e x t T e x t u r e T o o l s T r a d e
W i n d o w l e s s E g l A p p l i c a t i o n E g l C o n t e x t O p e n G L T e s t e r )
set ( _MAGNUM_PLUGIN_COMPONENTS
A n y A u d i o I m p o r t e r A n y I m a g e C o n v e r t e r A n y I m a g e I m p o r t e r A n y S c e n e C o n v e r t e r
A n y S c e n e I m p o r t e r M a g n u m F o n t M a g n u m F o n t C o n v e r t e r O b j I m p o r t e r
T g a I m a g e C o n v e r t e r T g a I m p o r t e r W a v A u d i o I m p o r t e r )
set ( _MAGNUM_EXECUTABLE_COMPONENTS
d i s t a n c e f i e l d c o n v e r t e r f o n t c o n v e r t e r i m a g e c o n v e r t e r s c e n e c o n v e r t e r
s h a d e r c o n v e r t e r g l - i n f o a l - i n f o )
i m a g e c o n v e r t e r s c e n e c o n v e r t e r s h a d e r c o n v e r t e r g l - i n f o a l - i n f o )
# A u d i o a n d V k l i b s a r e n ' t e n a b l e d b y d e f a u l t , a n d n o n e o f t h e C o n t e x t ,
# A p p l i c a t i o n , T e s t e r l i b s n o r p l u g i n s a r e . K e e p i n s y n c w i t h M a g n u m ' s r o o t
# C M a k e L i s t s . t x t .
set ( _MAGNUM_IMPLICITLY_ENABLED_COMPONENTS
D e b u g T o o l s M e s h T o o l s S c e n e G r a p h S h a d e r s S h a d e r T o o l s T e x t T e x t u r e T o o l s T r a d e
G L P r i m i t i v e s )
if ( NOT CORRADE_TARGET_EMSCRIPTEN )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS Vk )
endif ( )
if ( NOT CORRADE_TARGET_ANDROID )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS Sdl2Application )
endif ( )
if ( NOT CORRADE_TARGET_ANDROID AND NOT CORRADE_TARGET_IOS AND NOT CORRADE_TARGET_EMSCRIPTEN )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS GlfwApplication )
endif ( )
if ( CORRADE_TARGET_ANDROID )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS AndroidApplication )
endif ( )
if ( CORRADE_TARGET_EMSCRIPTEN )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS EmscriptenApplication )
endif ( )
if ( CORRADE_TARGET_IOS )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS WindowlessIosApplication )
endif ( )
if ( CORRADE_TARGET_APPLE AND NOT CORRADE_TARGET_IOS )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS WindowlessCglApplication CglContext )
endif ( )
if ( CORRADE_TARGET_UNIX AND NOT CORRADE_TARGET_APPLE )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS GlxApplication XEglApplication WindowlessGlxApplication GlxContext )
endif ( )
if ( CORRADE_TARGET_WINDOWS )
list ( APPEND _MAGNUM_LIBRARY_COMPONENTS WindowlessWglApplication WglContext WindowlessWindowsEglApplication )
endif ( )
if ( CORRADE_TARGET_UNIX OR CORRADE_TARGET_WINDOWS )
list ( APPEND _MAGNUM_EXECUTABLE_COMPONENTS fontconverter distancefieldconverter )
endif ( )
# 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
set ( _MAGNUM_Audio_DEPENDENCIES )
@ -497,6 +527,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
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
set ( _MAGNUM_ORIGINAL_FIND_COMPONENTS ${ Magnum_FIND_COMPONENTS } )
if ( _MAGNUM_ADDITIONAL_COMPONENTS )
list ( INSERT Magnum_FIND_COMPONENTS 0 ${ _MAGNUM_ADDITIONAL_COMPONENTS } )
endif ( )
@ -529,10 +560,9 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
find_library ( MAGNUM_ ${ _COMPONENT } _LIBRARY_RELEASE Magnum ${ _component } )
mark_as_advanced ( MAGNUM_ ${ _COMPONENT } _LIBRARY_DEBUG
M A G N U M _ $ { _ C O M P O N E N T } _ L I B R A R Y _ R E L E A S E )
endif ( )
# P l u g i n c o m p o n e n t s
if ( _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS )
else if( _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS )
add_library ( Magnum:: ${ _component } UNKNOWN IMPORTED )
# A u d i o I m p o r t e r p l u g i n s p e c i f i c n a m e s u f f i x e s
@ -600,6 +630,22 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# R e s e t b a c k
set ( CMAKE_FIND_LIBRARY_PREFIXES "${_tmp_prefixes}" )
# E x e c u t a b l e s
elseif ( _component IN_LIST _MAGNUM_EXECUTABLE_COMPONENTS )
add_executable ( Magnum:: ${ _component } IMPORTED )
find_program ( MAGNUM_ ${ _COMPONENT } _EXECUTABLE magnum- ${ _component } )
mark_as_advanced ( MAGNUM_ ${ _COMPONENT } _EXECUTABLE )
if ( MAGNUM_ ${ _COMPONENT } _EXECUTABLE )
set_property ( TARGET Magnum:: ${ _component } PROPERTY
I M P O R T E D _ L O C A T I O N $ { M A G N U M _ $ { _ C O M P O N E N T } _ E X E C U T A B L E } )
endif ( )
# S o m e t h i n g u n k n o w n , s k i p . F P H S A w i l l t a k e c a r e o f h a n d l i n g t h i s b e l o w .
else ( )
continue ( )
endif ( )
# L i b r a r y l o c a t i o n f o r l i b r a r i e s / p l u g i n s
@ -619,19 +665,6 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
endif ( )
endif ( )
# E x e c u t a b l e s
if ( _component IN_LIST _MAGNUM_EXECUTABLE_COMPONENTS )
add_executable ( Magnum:: ${ _component } IMPORTED )
find_program ( MAGNUM_ ${ _COMPONENT } _EXECUTABLE magnum- ${ _component } )
mark_as_advanced ( MAGNUM_ ${ _COMPONENT } _EXECUTABLE )
if ( MAGNUM_ ${ _COMPONENT } _EXECUTABLE )
set_property ( TARGET Magnum:: ${ _component } PROPERTY
I M P O R T E D _ L O C A T I O N $ { M A G N U M _ $ { _ C O M P O N E N T } _ E X E C U T A B L E } )
endif ( )
endif ( )
# A p p l i c a t i o n s
if ( _component MATCHES ".+Application" )
set ( _MAGNUM_ ${ _COMPONENT } _INCLUDE_PATH_SUFFIX Magnum/Platform )
@ -1005,11 +1038,45 @@ if(CORRADE_TARGET_EMSCRIPTEN)
endif ( )
endif ( )
# 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 ( _MAGNUM_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 ${ _MAGNUM_ORIGINAL_FIND_COMPONENTS } )
if ( Magnum_ ${ _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 _MAGNUM_LIBRARY_COMPONENTS AND NOT _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS AND NOT _component IN_LIST _MAGNUM_EXECUTABLE_COMPONENTS )
list ( APPEND _MAGNUM_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 _MAGNUM_IMPLICITLY_ENABLED_COMPONENTS )
string ( TOUPPER ${ _component } _COMPONENT )
list ( APPEND _MAGNUM_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum." )
# 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 ";" " " _MAGNUM_REASON_FAILURE_MESSAGE "${_MAGNUM_REASON_FAILURE_MESSAGE}" )
set ( _MAGNUM_REASON_FAILURE_MESSAGE REASON_FAILURE_MESSAGE "${_MAGNUM_REASON_FAILURE_MESSAGE}" )
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
R E Q U I R E D _ V A R S M A G N U M _ I N C L U D E _ D I R M A G N U M _ L I B R A R Y $ { M A G N U M _ E X T R A S _ N E E D E D }
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 _ R E A S O N _ F A I L U R E _ M E S S A G E } )
# C o m p o n e n t s w i t h o p t i o n a l d e p e n d e n c i e s - - a d d t h e m o n c e w e k n o w i f t h e y w e r e
# f o u n d o r n o t .