@ -638,12 +638,17 @@ endif()
#
#
# P r e p a r e o p t i o n a l l i b s f o r s h a r e d a n d s t a t i c F L T K l i b r a r i e s .
# P r e p a r e o p t i o n a l l i b s f o r s h a r e d a n d s t a t i c F L T K l i b r a r i e s .
#
#
# N o t e : ' O P T I O N A L _ L I B S ' i s a C M a k e ' l i s t ' b u t m u s t n o t c o n t a i n a r b i t r a r y
# N o t e s :
# - ' O P T I O N A L _ L I B S ' i s a C M a k e ' l i s t ' b u t m u s t n o t c o n t a i n a r b i t r a r y
# C M a k e t a r g e t s b e c a u s e t h e s e t a r g e t s w o u l d b e p r o p a g a t e d t o
# C M a k e t a r g e t s b e c a u s e t h e s e t a r g e t s w o u l d b e p r o p a g a t e d t o
# c o n s u m e r p r o j e c t s . T h e m a c r o b e l o w s i m p l i f i e s a d d i n g l i n k
# c o n s u m e r p r o j e c t s . T h e m a c r o b e l o w s i m p l i f i e s a d d i n g l i n k
# l i b r a r i e s o f s u c h t a r g e t s t o ' O P T I O N A L _ L I B S ' .
# l i b r a r i e s o f s u c h t a r g e t s t o ' O P T I O N A L _ L I B S ' .
# - ' O P T I O N A L _ I N C L U D E S ' i s a s i m i l a r C M a k e l i s t t h a t d e f i n e s a d d i t i o n a l
# i n c l u d e d i r e c t o r i e s .
#
# T h i s m a c r o a p p e n d s l i n k l i b r a r i e s t o ' O P T I O N A L _ L I B S ' a n d i n c l u d e
# d i r e c t o r i e s t o ' O P T I O N A L _ I N C L U D E S ' .
#
#
# T h i s m a c r o a p p e n d s i n t e r f a c e t a r g e t s t o ' O P T I O N A L _ L I B S ' .
# I n p u t :
# I n p u t :
# ' t a r g e t s ' m a y b e a C M a k e l i s t o f t a r g e t s o r a s i n g l e t a r g e t .
# ' t a r g e t s ' m a y b e a C M a k e l i s t o f t a r g e t s o r a s i n g l e t a r g e t .
# I t m u s t b e q u o t e d i f m u l t i p l e t a r g e t s a r e t o b e a d d e d i n
# I t m u s t b e q u o t e d i f m u l t i p l e t a r g e t s a r e t o b e a d d e d i n
@ -654,14 +659,19 @@ endif()
macro ( append_optional_libs targets )
macro ( append_optional_libs targets )
foreach ( _target ${ targets } )
foreach ( _target ${ targets } )
get_target_property ( _link_libraries ${ _target } INTERFACE_LINK_LIBRARIES )
get_target_property ( _link_libraries ${ _target } INTERFACE_LINK_LIBRARIES )
get_target_property ( _include_dirs ${ _target } INTERFACE_INCLUDE_DIRECTORIES )
list ( APPEND OPTIONAL_LIBS ${ _link_libraries } )
list ( APPEND OPTIONAL_LIBS ${ _link_libraries } )
list ( APPEND OPTIONAL_LIBS )
if ( _include_dirs )
list ( APPEND OPTIONAL_INCLUDES ${ _include_dirs } )
endif ( )
endforeach ( )
endforeach ( )
unset ( _target )
unset ( _target )
unset ( _link_libraries )
unset ( _link_libraries )
unset ( _include_dirs )
endmacro ( )
endmacro ( )
set ( OPTIONAL_LIBS )
set ( OPTIONAL_LIBS )
set ( OPTIONAL_INCLUDES )
if ( LIB_dl )
if ( LIB_dl )
list ( APPEND OPTIONAL_LIBS ${ LIB_dl } )
list ( APPEND OPTIONAL_LIBS ${ LIB_dl } )
@ -796,11 +806,13 @@ if(UNIX AND FLTK_BACKEND_WAYLAND)
endif ( UNIX AND FLTK_BACKEND_WAYLAND )
endif ( UNIX AND FLTK_BACKEND_WAYLAND )
list ( REMOVE_DUPLICATES OPTIONAL_LIBS )
list ( REMOVE_DUPLICATES OPTIONAL_LIBS )
list ( REMOVE_DUPLICATES OPTIONAL_INCLUDES )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
fl_add_library ( fltk STATIC "${STATIC_FILES}" )
fl_add_library ( fltk STATIC "${STATIC_FILES}" )
target_link_libraries ( fltk PRIVATE ${ OPTIONAL_LIBS } )
target_link_libraries ( fltk PRIVATE ${ OPTIONAL_LIBS } )
target_include_directories ( fltk PRIVATE ${ OPTIONAL_INCLUDES } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@ -851,6 +863,7 @@ if(FLTK_BUILD_SHARED_LIBS AND NOT MSVC)
fl_add_library ( fltk SHARED "${SHARED_FILES}" )
fl_add_library ( fltk SHARED "${SHARED_FILES}" )
target_link_libraries ( fltk-shared PRIVATE ${ OPTIONAL_LIBS } )
target_link_libraries ( fltk-shared PRIVATE ${ OPTIONAL_LIBS } )
target_include_directories ( fltk-shared PRIVATE ${ OPTIONAL_INCLUDES } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@ -920,6 +933,7 @@ if(FLTK_BUILD_SHARED_LIBS AND MSVC)
fl_add_library ( fltk SHARED "${SOURCES}" )
fl_add_library ( fltk SHARED "${SOURCES}" )
target_link_libraries ( fltk-shared PRIVATE ${ OPTIONAL_LIBS } )
target_link_libraries ( fltk-shared PRIVATE ${ OPTIONAL_LIBS } )
target_include_directories ( fltk-shared PRIVATE ${ OPTIONAL_INCLUDES } )
if ( FLTK_USE_BUNDLED_JPEG )
if ( FLTK_USE_BUNDLED_JPEG )
target_link_libraries ( fltk-shared PUBLIC fltk::jpeg-shared )
target_link_libraries ( fltk-shared PUBLIC fltk::jpeg-shared )