@ -396,7 +396,71 @@ function(set_suyu_qt_components)
set ( SUYU_QT_COMPONENTS ${ SUYU_QT_COMPONENTS2 } PARENT_SCOPE )
set ( SUYU_QT_COMPONENTS ${ SUYU_QT_COMPONENTS2 } PARENT_SCOPE )
endfunction ( set_suyu_qt_components )
endfunction ( set_suyu_qt_components )
# f i n d S D L 2 e x p o r t s a b u n c h o f v a r i a b l e s t h a t a r e n e e d e d , s o i t s e a s i e r t o d o t h i s o u t s i d e o f t h e s u y u _ f i n d _ p a c k a g e
if ( ENABLE_SDL2 )
if ( SUYU_USE_BUNDLED_SDL2 )
# D e t e c t t o o l c h a i n a n d p l a t f o r m
if ( ( MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940 ) AND ARCHITECTURE_x86_64 )
set ( SDL2_VER "SDL2-2.28.2" )
else ( )
message ( FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable SUYU_USE_BUNDLED_SDL2 and provide your own." )
endif ( )
if ( DEFINED SDL2_VER )
download_bundled_external ( "sdl2/" ${ SDL2_VER } SDL2_PREFIX )
endif ( )
set ( SDL2_FOUND YES )
set ( SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include" CACHE PATH "Path to SDL2 headers" )
set ( SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library" )
set ( SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll" )
add_library ( SDL2::SDL2 INTERFACE IMPORTED )
target_link_libraries ( SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}" )
target_include_directories ( SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}" )
elseif ( SUYU_USE_EXTERNAL_SDL2 )
message ( STATUS "Using SDL2 from externals." )
else ( )
find_package ( SDL2 2.26.4 REQUIRED )
endif ( )
endif ( )
# L i s t o f a l l F F m p e g c o m p o n e n t s r e q u i r e d
set ( FFmpeg_COMPONENTS
a v c o d e c
a v f i l t e r
a v u t i l
s w s c a l e )
if ( UNIX AND NOT APPLE AND NOT ANDROID )
find_package ( PkgConfig REQUIRED )
pkg_check_modules ( LIBVA libva )
endif ( )
if ( NOT SUYU_USE_BUNDLED_FFMPEG )
# U s e s y s t e m i n s t a l l e d F F m p e g
find_package ( FFmpeg 4.3 REQUIRED QUIET COMPONENTS ${ FFmpeg_COMPONENTS } )
endif ( )
if ( WIN32 AND SUYU_CRASH_DUMPS )
set ( BREAKPAD_VER "breakpad-c89f9dd" )
download_bundled_external ( "breakpad/" ${ BREAKPAD_VER } BREAKPAD_PREFIX )
set ( BREAKPAD_CLIENT_INCLUDE_DIR "${BREAKPAD_PREFIX}/include" )
set ( BREAKPAD_CLIENT_LIBRARY "${BREAKPAD_PREFIX}/lib/libbreakpad_client.lib" )
add_library ( libbreakpad_client INTERFACE IMPORTED )
target_link_libraries ( libbreakpad_client INTERFACE "${BREAKPAD_CLIENT_LIBRARY}" )
target_include_directories ( libbreakpad_client INTERFACE "${BREAKPAD_CLIENT_INCLUDE_DIR}" )
endif ( )
# P r e f e r t h e - p t h r e a d f l a g o n L i n u x .
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
add_subdirectory ( externals )
# Q t 5 r e q u i r e s t h a t w e f i n d c o m p o n e n t s , s o i t d o e s n ' t f i t o u r p r e t t y l i t t l e f i n d p a c k a g e f u n c t i o n
# Q t 5 r e q u i r e s t h a t w e f i n d c o m p o n e n t s , s o i t d o e s n ' t f i t o u r p r e t t y l i t t l e f i n d p a c k a g e f u n c t i o n
# Q t 6 s e t s V u l k a n : : H e a d e r s , s o Q t s e a r c h h a s t o c o m e a f t e r e x t e r n a l s , s o i t d o e s n ' t g e t t o d o i t .
if ( ENABLE_QT )
if ( ENABLE_QT )
set ( QT_VERSION 5.15 )
set ( QT_VERSION 5.15 )
# T h e s e a r e u s e d t o s p e c i f y m i n i m u m v e r s i o n s
# T h e s e a r e u s e d t o s p e c i f y m i n i m u m v e r s i o n s
@ -535,67 +599,6 @@ if(ENABLE_QT)
endif ( )
endif ( )
# f i n d S D L 2 e x p o r t s a b u n c h o f v a r i a b l e s t h a t a r e n e e d e d , s o i t s e a s i e r t o d o t h i s o u t s i d e o f t h e s u y u _ f i n d _ p a c k a g e
if ( ENABLE_SDL2 )
if ( SUYU_USE_BUNDLED_SDL2 )
# D e t e c t t o o l c h a i n a n d p l a t f o r m
if ( ( MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940 ) AND ARCHITECTURE_x86_64 )
set ( SDL2_VER "SDL2-2.28.2" )
else ( )
message ( FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable SUYU_USE_BUNDLED_SDL2 and provide your own." )
endif ( )
if ( DEFINED SDL2_VER )
download_bundled_external ( "sdl2/" ${ SDL2_VER } SDL2_PREFIX )
endif ( )
set ( SDL2_FOUND YES )
set ( SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include" CACHE PATH "Path to SDL2 headers" )
set ( SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library" )
set ( SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll" )
add_library ( SDL2::SDL2 INTERFACE IMPORTED )
target_link_libraries ( SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}" )
target_include_directories ( SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}" )
elseif ( SUYU_USE_EXTERNAL_SDL2 )
message ( STATUS "Using SDL2 from externals." )
else ( )
find_package ( SDL2 2.26.4 REQUIRED )
endif ( )
endif ( )
# L i s t o f a l l F F m p e g c o m p o n e n t s r e q u i r e d
set ( FFmpeg_COMPONENTS
a v c o d e c
a v f i l t e r
a v u t i l
s w s c a l e )
if ( UNIX AND NOT APPLE AND NOT ANDROID )
find_package ( PkgConfig REQUIRED )
pkg_check_modules ( LIBVA libva )
endif ( )
if ( NOT SUYU_USE_BUNDLED_FFMPEG )
# U s e s y s t e m i n s t a l l e d F F m p e g
find_package ( FFmpeg 4.3 REQUIRED QUIET COMPONENTS ${ FFmpeg_COMPONENTS } )
endif ( )
if ( WIN32 AND SUYU_CRASH_DUMPS )
set ( BREAKPAD_VER "breakpad-c89f9dd" )
download_bundled_external ( "breakpad/" ${ BREAKPAD_VER } BREAKPAD_PREFIX )
set ( BREAKPAD_CLIENT_INCLUDE_DIR "${BREAKPAD_PREFIX}/include" )
set ( BREAKPAD_CLIENT_LIBRARY "${BREAKPAD_PREFIX}/lib/libbreakpad_client.lib" )
add_library ( libbreakpad_client INTERFACE IMPORTED )
target_link_libraries ( libbreakpad_client INTERFACE "${BREAKPAD_CLIENT_LIBRARY}" )
target_include_directories ( libbreakpad_client INTERFACE "${BREAKPAD_CLIENT_INCLUDE_DIR}" )
endif ( )
# P r e f e r t h e - p t h r e a d f l a g o n L i n u x .
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
# P l a t f o r m - s p e c i f i c l i b r a r y r e q u i r e m e n t s
# P l a t f o r m - s p e c i f i c l i b r a r y r e q u i r e m e n t s
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@ -710,7 +713,6 @@ if (SUYU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif ( )
endif ( )
endif ( )
endif ( )
add_subdirectory ( externals )
add_subdirectory ( src )
add_subdirectory ( src )
# S e t s u y u p r o j e c t o r s u y u - c m d p r o j e c t a s d e f a u l t S t a r t U p P r o j e c t i n V i s u a l S t u d i o d e p e n d i n g o n w h e t h e r Q T i s e n a b l e d o r n o t
# S e t s u y u p r o j e c t o r s u y u - c m d p r o j e c t a s d e f a u l t S t a r t U p P r o j e c t i n V i s u a l S t u d i o d e p e n d i n g o n w h e t h e r Q T i s e n a b l e d o r n o t