@ -31,7 +31,9 @@ else()
if ( DEVILUTIONX_SYSTEM_SDL2 )
if ( DEVILUTIONX_SYSTEM_SDL2 )
find_package ( SDL2 REQUIRED )
find_package ( SDL2 REQUIRED )
if ( TARGET SDL2::SDL2 )
if ( TARGET SDL2::SDL2 )
set ( SDL2_MAIN SDL2::SDL2main )
if ( TARGET SDL2::SDL2main )
set ( SDL2_MAIN SDL2::SDL2main )
endif ( )
elseif ( TARGET SDL2::SDL2-static )
elseif ( TARGET SDL2::SDL2-static )
# O n s o m e d i s t r o s , s u c h a s v i t a s d k , o n l y t h e S D L 2 : : S D L 2 - s t a t i c t a r g e t i s a v a i l a b l e .
# O n s o m e d i s t r o s , s u c h a s v i t a s d k , o n l y t h e S D L 2 : : S D L 2 - s t a t i c t a r g e t i s a v a i l a b l e .
# A l i a s t o S D L 2 : : S D L 2 b e c a u s e s o m e f i n d e r s c r i p t s m a y r e f e r t o S D L 2 : : S D L 2 .
# A l i a s t o S D L 2 : : S D L 2 b e c a u s e s o m e f i n d e r s c r i p t s m a y r e f e r t o S D L 2 : : S D L 2 .
@ -39,7 +41,9 @@ else()
# A l i a s i n g l o c a l t a r g e t s i s n o t s u p p o r t e d o n C M a k e < 3 . 1 8 , s o m a k e i t g l o b a l .
# A l i a s i n g l o c a l t a r g e t s i s n o t s u p p o r t e d o n C M a k e < 3 . 1 8 , s o m a k e i t g l o b a l .
set_target_properties ( SDL2::SDL2-static PROPERTIES IMPORTED_GLOBAL TRUE )
set_target_properties ( SDL2::SDL2-static PROPERTIES IMPORTED_GLOBAL TRUE )
endif ( )
endif ( )
set ( SDL2_MAIN SDL2::SDL2main )
if ( TARGET SDL2::SDL2main )
set ( SDL2_MAIN SDL2::SDL2main )
endif ( )
else ( )
else ( )
# A s s u m e a n o l d e r D e b i a n d e r i v a t e t h a t c o m e s w i t h a n s d l 2 - c o n f i g . c m a k e
# A s s u m e a n o l d e r D e b i a n d e r i v a t e t h a t c o m e s w i t h a n s d l 2 - c o n f i g . c m a k e
# t h a t o n l y d e f i n e s ` S D L 2 _ L I B R A R I E S ` ( a s - l S D L 2 ) a n d ` S D L 2 _ I N C L U D E _ D I R S ` .
# t h a t o n l y d e f i n e s ` S D L 2 _ L I B R A R I E S ` ( a s - l S D L 2 ) a n d ` S D L 2 _ I N C L U D E _ D I R S ` .
@ -54,7 +58,9 @@ else()
find_package ( SDL2 REQUIRED )
find_package ( SDL2 REQUIRED )
else ( )
else ( )
add_subdirectory ( 3rdParty/SDL2 )
add_subdirectory ( 3rdParty/SDL2 )
set ( SDL2_MAIN SDL2::SDL2main )
if ( TARGET SDL2::SDL2main )
set ( SDL2_MAIN SDL2::SDL2main )
endif ( )
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/SDL2/CMake" )
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/SDL2/CMake" )
endif ( )
endif ( )
endif ( )
endif ( )