2018-03-04 14:41:16 +00:00
#Note: this file was made primarily to support msvc and its project file incompatibilities nightmare.
CMAKE_MINIMUM_REQUIRED ( VERSION 3.0 )
PROJECT ( fteqw )
INCLUDE_DIRECTORIES (
e n g i n e / c o m m o n
e n g i n e / c l i e n t
e n g i n e / q c l i b
e n g i n e / g l
e n g i n e / s e r v e r
e n g i n e
)
EXECUTE_PROCESS ( COMMAND
" e c h o " h e l l o w o r l d
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ S O U R C E _ D I R } "
O U T P U T _ V A R I A B L E F T E _ R E V I S O N
E R R O R _ Q U I E T O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
IF ( NOT "${FTE_REVISON}" STREQUAL "" )
SET ( FTE_REVISON SVNREVISION= ${ FTE_REVISON } )
ENDIF ( )
#plugins need visibility hidden in order to avoid conflicts with function names that match the engine.
#this is consistent with how windows works so no great loss.
#plus it means that gcc can inline more (with LTO), including optimising args.
set ( CMAKE_CXX_VISIBILITY_PRESET hidden )
set ( CMAKE_C_VISIBILITY_PRESET hidden )
#use LTO where possible. reportedly requires cmake 3.9 to actually work
set ( CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE )
IF ( ${ WIN32 } )
INCLUDE_DIRECTORIES ( engine/libs engine/libs/freetype2/include )
# LINK_DIRECTORIES(engine/libs/mingw64-libs)
# engine/server/sv_sys_win.c
SET ( FTE_LIBS z ole32 gdi32 wsock32 winmm )
SET ( FTE_DEFINES GLQUAKE;VKQUAKE;D3D9QUAKE;DYNAMIC_LIBPNG;DYNAMIC_LIBJPEG ) #D3D11QUAKE not included.
SET ( FTE_ARCH_FILES
e n g i n e / c l i e n t / w i n q u a k e . r c
e n g i n e / c o m m o n / s y s _ w i n _ t h r e a d s . c
e n g i n e / c o m m o n / n e t _ s s l _ w i n s s p i . c
e n g i n e / c o m m o n / f s _ w i n 3 2 . c
e n g i n e / c l i e n t / c d _ w i n . c
e n g i n e / c l i e n t / i n _ w i n . c
e n g i n e / c l i e n t / s n d _ a l . c
e n g i n e / c l i e n t / s n d _ d i r e c t x . c
e n g i n e / c l i e n t / s n d _ w a s a p i . c
e n g i n e / c l i e n t / s n d _ w i n . c
e n g i n e / c l i e n t / s n d _ x a u d i o . c
e n g i n e / c l i e n t / s y s _ w i n . c
e n g i n e / g l / g l _ v i d n t . c
e n g i n e / d 3 d / d 3 d _ b a c k e n d . c
e n g i n e / d 3 d / d 3 d _ i m a g e . c
e n g i n e / d 3 d / d 3 d _ s h a d e r . c
e n g i n e / d 3 d / d 3 d 1 1 _ b a c k e n d . c
e n g i n e / d 3 d / d 3 d 1 1 _ i m a g e . c
e n g i n e / d 3 d / d 3 d 1 1 _ s h a d e r . c
e n g i n e / d 3 d / d 3 d 8 _ b a c k e n d . c
e n g i n e / d 3 d / d 3 d 8 _ i m a g e . c
e n g i n e / d 3 d / v i d _ d 3 d . c
e n g i n e / d 3 d / v i d _ d 3 d 1 1 . c
e n g i n e / d 3 d / v i d _ d 3 d 8 . c
)
SET ( FTESV_LIBS z wsock32 winmm )
SET ( FTESV_ARCH_FILES
e n g i n e / c l i e n t / w i n q u a k e . r c
e n g i n e / c o m m o n / s y s _ w i n _ t h r e a d s . c
e n g i n e / c o m m o n / n e t _ s s l _ w i n s s p i . c
e n g i n e / c o m m o n / f s _ w i n 3 2 . c
e n g i n e / s e r v e r / s v _ s y s _ w i n . c
)
ELSEIF ( ${ UNIX } ) #linux(ish)
FIND_PACKAGE ( Freetype REQUIRED )
INCLUDE_DIRECTORIES ( ${ FREETYPE_INCLUDE_DIRS } )
SET ( FTE_DEFINES GLQUAKE;VKQUAKE;DYNAMIC_LIBPNG;DYNAMIC_LIBJPEG;DYNAMIC_SDL;MULTITHREAD;stricmp=strcasecmp;strnicmp=strncasecmp )
SET ( FTE_LIBS z m dl pthread ${ SDL2_LIBRARIES } )
SET ( FTE_ARCH_FILES
e n g i n e / c l i e n t / s y s _ l i n u x . c
e n g i n e / c o m m o n / s y s _ l i n u x _ t h r e a d s . c
e n g i n e / c o m m o n / n e t _ s s l _ g n u t l s . c
e n g i n e / c l i e n t / s n d _ a l . c
e n g i n e / c l i e n t / s n d _ a l s a . c
e n g i n e / c l i e n t / s n d _ l i n u x . c
e n g i n e / c l i e n t / s n d _ s d l . c #we use SDL audio even without sys_sdl, because of pulseaudio fucking over alsa, alsa fucking over oss3, and oss4 not being used. Either way, openal should be the default anyway.
e n g i n e / c l i e n t / c d _ l i n u x . c
e n g i n e / g l / g l _ v i d l i n u x g l x . c
e n g i n e / g l / g l _ v i d e g l . c
# engine/gl/gl_vidrpi.c
# engine/gl/gl_vidwayland.c
)
SET ( FTESV_DEFINES stricmp=strcasecmp;strnicmp=strncasecmp )
SET ( FTESV_ARCH_FILES
e n g i n e / s e r v e r / s v _ s y s _ u n i x . c
e n g i n e / c o m m o n / s y s _ l i n u x _ t h r e a d s . c
e n g i n e / c o m m o n / n e t _ s s l _ g n u t l s . c
)
SET ( FTESV_LIBS z m dl )
ELSEIF ( 1 ) #SDL
FIND_PACKAGE ( Freetype REQUIRED )
# INCLUDE_DIRECTORIES(engine/libs engine/libs/freetype2/include)
FIND_PACKAGE ( PkgConfig REQUIRED )
PKG_SEARCH_MODULE ( sdl2 REQUIRED sdl2 )
# FIND_PACKAGE(SDL2 REQUIRED)
INCLUDE_DIRECTORIES ( ${ FREETYPE_INCLUDE_DIRS } ${ SDL2_INCLUDE_DIRS } )
#SDL2.0.7 supports vulkan, so lets use it.
SET ( FTE_DEFINES GLQUAKE;VKQUAKE;FTE_SDL;DYNAMIC_LIBPNG;DYNAMIC_LIBJPEG;stricmp=strcasecmp;strnicmp=strncasecmp )
SET ( FTE_LIBS z m dl ${ SDL2_LIBRARIES } )
SET ( FTE_ARCH_FILES
e n g i n e / c l i e n t / s y s _ s d l . c
e n g i n e / c l i e n t / s n d _ a l . c
e n g i n e / c l i e n t / s n d _ s d l . c
e n g i n e / c l i e n t / i n _ s d l . c
e n g i n e / c l i e n t / c d _ s d l . c
e n g i n e / g l / g l _ v i d s d l . c
)
SET ( FTESV_DEFINES FTE_SDL;stricmp=strcasecmp;strnicmp=strncasecmp )
SET ( FTESV_LIBS z m dl ${ SDL2_LIBRARIES } )
IF ( WIN32 )
SET ( FTE_LIBS ${ FTE_LIBS } wsock32 gdi32 ole32 )
SET ( FTE_DEFINES ${ FTE_DEFINES } ;NO_DIRECTX )
SET ( FTE_ARCH_FILES ${ FTE_ARCH_FILES }
e n g i n e / c l i e n t / w i n q u a k e . r c
e n g i n e / c o m m o n / n e t _ s s l _ w i n s s p i . c
)
SET ( FTESV_ARCH_FILES ${ FTESV_ARCH_FILES }
e n g i n e / c l i e n t / w i n q u a k e . r c
e n g i n e / c o m m o n / n e t _ s s l _ w i n s s p i . c
e n g i n e / s e r v e r / s v _ s y s _ w i n . c
)
ELSE ( )
SET ( FTE_ARCH_FILES ${ FTE_ARCH_FILES }
e n g i n e / c o m m o n / n e t _ s s l _ g n u t l s . c
)
SET ( FTESV_ARCH_FILES ${ FTESV_ARCH_FILES }
e n g i n e / c o m m o n / n e t _ s s l _ g n u t l s . c
e n g i n e / c o m m o n / s y s _ l i n u x _ t h r e a d s . c
e n g i n e / s e r v e r / s v _ s y s _ u n i x . c
)
ENDIF ( )
ELSE ( )
# engine/common/sys_linux_threads.c
# engine/common/net_ssl_gnutls.c
# engine/server/sv_sys_unix.c
# engine/client/snd_alsa.c
# engine/client/snd_droid.c
# engine/client/snd_linux.c
# engine/client/snd_macos.c
# engine/client/snd_morphos.c
# engine/client/snd_sblaster.c
# engine/client/snd_sdl.c
# engine/client/snd_sndio.c
# engine/client/sys_dos.c
# engine/client/sys_droid.c
# engine/client/sys_linux.c
# engine/client/sys_morphos.c
# engine/client/sys_npfte.c
# engine/client/sys_plugfte.c
# engine/client/sys_sdl.c
# engine/client/sys_xdk.c
# engine/client/cd_linux.c
# engine/client/cd_null.c
# engine/client/cd_sdl.c
# engine/client/in_morphos.c
# engine/client/in_sdl.c
# engine/gl/gl_viddroid.c
# engine/gl/gl_videgl.c
# engine/gl/gl_vidlinuxglx.c
# engine/gl/gl_vidmacos.c
# engine/gl/gl_vidmorphos.c
# engine/gl/gl_vidnull.c
# engine/gl/gl_vidrpi.c
# engine/gl/gl_vidsdl.c
# engine/gl/gl_vidtinyglstubs.c
# engine/gl/gl_vidwayland.c
ENDIF ( )
SET ( FTE_COMMON_FILES
#these files are common to both server-only and client+server builds.
e n g i n e / c o m m o n / c m d . c
e n g i n e / c o m m o n / c o m _ m e s h . c
e n g i n e / c o m m o n / c o m m o n . c
e n g i n e / c o m m o n / c r c . c
e n g i n e / c o m m o n / c v a r . c
e n g i n e / c o m m o n / f s . c
e n g i n e / c o m m o n / f s _ d z i p . c
e n g i n e / c o m m o n / f s _ p a k . c
e n g i n e / c o m m o n / f s _ s t d i o . c
e n g i n e / c o m m o n / f s _ x z . c
e n g i n e / c o m m o n / f s _ z i p . c
e n g i n e / c o m m o n / g l _ q 2 b s p . c
e n g i n e / c o m m o n / h u f f . c
e n g i n e / c o m m o n / l o g . c
e n g i n e / c o m m o n / m a t h l i b . c
e n g i n e / c o m m o n / m d 4 . c
e n g i n e / c o m m o n / n e t _ c h a n . c
e n g i n e / c o m m o n / n e t _ i c e . c
e n g i n e / c o m m o n / n e t _ w i n s . c
e n g i n e / c o m m o n / p l u g i n . c
e n g i n e / c o m m o n / p m o v e . c
e n g i n e / c o m m o n / p m o v e t s t . c
e n g i n e / c o m m o n / p r _ b g c m d . c
e n g i n e / c o m m o n / q 1 b s p . c
e n g i n e / c o m m o n / q 2 p m o v e . c
e n g i n e / c o m m o n / q 3 c o m m o n . c
e n g i n e / c o m m o n / q v m . c
e n g i n e / c o m m o n / s h a 1 . c
e n g i n e / c o m m o n / t r a n s l a t e . c
e n g i n e / c o m m o n / z o n e . c
#sigh
e n g i n e / c l i e n t / p r _ s k e l o b j . c
e n g i n e / c l i e n t / m _ d o w n l o a d . c
e n g i n e / c l i e n t / n e t _ m a s t e r . c
#these are here because of hitmodel etc
e n g i n e / g l / g l _ h e i g h t m a p . c
e n g i n e / g l / g l _ h l m d l . c
e n g i n e / g l / g l _ m o d e l . c
e n g i n e / s e r v e r / n e t _ p r e p a r s e . c
e n g i n e / s e r v e r / p r _ c m d s . c
e n g i n e / s e r v e r / p r _ l u a . c
e n g i n e / s e r v e r / p r _ q 1 q v m . c
e n g i n e / s e r v e r / s a v e g a m e . c
e n g i n e / s e r v e r / s v _ c c m d s . c
e n g i n e / s e r v e r / s v _ c h a t . c
e n g i n e / s e r v e r / s v _ c l u s t e r . c
e n g i n e / s e r v e r / s v _ d e m o . c
e n g i n e / s e r v e r / s v _ e n t s . c
e n g i n e / s e r v e r / s v _ i n i t . c
e n g i n e / s e r v e r / s v _ m a i n . c
e n g i n e / s e r v e r / s v _ m a s t e r . c
e n g i n e / s e r v e r / s v _ m o v e . c
e n g i n e / s e r v e r / s v _ m v d . c
e n g i n e / s e r v e r / s v _ n c h a n . c
e n g i n e / s e r v e r / s v _ p h y s . c
e n g i n e / s e r v e r / s v _ r a n k i n . c
e n g i n e / s e r v e r / s v _ s e n d . c
e n g i n e / s e r v e r / s v _ s q l . c
e n g i n e / s e r v e r / s v _ u s e r . c
# engine/server/svhl_game.c
# engine/server/svhl_phys.c
# engine/server/svhl_world.c
e n g i n e / s e r v e r / s v q 2 _ e n t s . c
e n g i n e / s e r v e r / s v q 2 _ g a m e . c
e n g i n e / s e r v e r / s v q 3 _ g a m e . c
e n g i n e / s e r v e r / w o r l d . c
e n g i n e / q c l i b / c o m p r o u t . c
e n g i n e / q c l i b / h a s h . c
e n g i n e / q c l i b / i n i t l i b . c
e n g i n e / q c l i b / p r _ e d i c t . c
e n g i n e / q c l i b / p r _ e x e c . c
e n g i n e / q c l i b / p r _ m u l t i . c
e n g i n e / q c l i b / q c c _ c m d l i b . c
e n g i n e / q c l i b / q c c _ p r _ c o m p . c
e n g i n e / q c l i b / q c c _ p r _ l e x . c
# engine/qclib/decomp.c
# engine/qclib/packager.c
# engine/qclib/pr_x86.c
# engine/qclib/qccgui.c
# engine/qclib/qccguistuff.c
# engine/qclib/qcctui.c
e n g i n e / q c l i b / q c c m a i n . c
e n g i n e / q c l i b / q c d _ m a i n . c
e n g i n e / q c l i b / q c d e c o m p . c
e n g i n e / h t t p / h t t p c l i e n t . c
)
ADD_EXECUTABLE ( fteqw WIN32
$ { F T E _ A R C H _ F I L E S }
$ { F T E _ C O M M O N _ F I L E S }
e n g i n e / c l i e n t / c l _ c a m . c
e n g i n e / c l i e n t / c l _ c g . c
e n g i n e / c l i e n t / c l _ d e m o . c
e n g i n e / c l i e n t / c l _ e n t s . c
e n g i n e / c l i e n t / c l _ i g n o r e . c
e n g i n e / c l i e n t / c l _ i n p u t . c
e n g i n e / c l i e n t / c l _ m a i n . c
e n g i n e / c l i e n t / c l _ p a r s e . c
e n g i n e / c l i e n t / c l _ p r e d . c
e n g i n e / c l i e n t / c l _ s c r e e n . c
e n g i n e / c l i e n t / c l _ t e n t . c
e n g i n e / c l i e n t / c l _ u i . c
# engine/client/clhl_game.c
e n g i n e / c l i e n t / c l q 2 _ c i n . c
e n g i n e / c l i e n t / c l q 2 _ e n t s . c
e n g i n e / c l i e n t / c l q 3 _ p a r s e . c
e n g i n e / c l i e n t / c o n s o l e . c
e n g i n e / c l i e n t / f r a g s t a t s . c
e n g i n e / c l i e n t / i m a g e . c
e n g i n e / c l i e n t / i n _ g e n e r i c . c
e n g i n e / c l i e n t / k e y s . c
e n g i n e / c l i e n t / m _ i t e m s . c
e n g i n e / c l i e n t / m _ m a s t e r . c
e n g i n e / c l i e n t / m _ m p 3 . c
e n g i n e / c l i e n t / m _ m u l t i . c
e n g i n e / c l i e n t / m _ o p t i o n s . c
e n g i n e / c l i e n t / m _ s c r i p t . c
2018-05-21 13:47:53 +00:00
e n g i n e / c l i e n t / m _ n a t i v e . c
2018-03-04 14:41:16 +00:00
e n g i n e / c l i e n t / m _ s i n g l e . c
e n g i n e / c l i e n t / m e n u . c
e n g i n e / c l i e n t / p _ c l a s s i c . c
e n g i n e / c l i e n t / p _ n u l l . c
e n g i n e / c l i e n t / p _ s c r i p t . c
e n g i n e / c l i e n t / p r _ c l c m d . c
e n g i n e / c l i e n t / p r _ c s q c . c
e n g i n e / c l i e n t / p r _ m e n u . c
e n g i n e / c l i e n t / r _ 2 d . c
e n g i n e / c l i e n t / r _ d 3 . c
e n g i n e / c l i e n t / r _ p a r t . c
e n g i n e / c l i e n t / r _ p a r t s e t . c
e n g i n e / c l i e n t / r _ s u r f . c
e n g i n e / c l i e n t / r e n d e r e r . c
e n g i n e / c l i e n t / r e n d e r q u e . c
e n g i n e / c l i e n t / r o q _ r e a d . c
e n g i n e / c l i e n t / s b a r . c
e n g i n e / c l i e n t / s k i n . c
e n g i n e / c l i e n t / s n d _ d m a . c
e n g i n e / c l i e n t / s n d _ m e m . c
e n g i n e / c l i e n t / s n d _ m i x . c
e n g i n e / c l i e n t / s n d _ m p 3 . c
e n g i n e / c l i e n t / s n d _ o v . c
e n g i n e / c l i e n t / t e x t e d i t . c
e n g i n e / c l i e n t / v a l i d . c
e n g i n e / c l i e n t / v i d _ h e a d l e s s . c
e n g i n e / c l i e n t / v i e w . c
e n g i n e / c l i e n t / w a d . c
e n g i n e / c l i e n t / z q t p . c
#These are generic renderer files
e n g i n e / g l / g l _ a l i a s . c
e n g i n e / g l / g l _ f o n t . c
e n g i n e / g l / g l _ n g r a p h . c
e n g i n e / g l / g l _ r l i g h t . c
e n g i n e / g l / g l _ s h a d e r . c
e n g i n e / g l / g l _ s h a d o w . c
e n g i n e / g l / g l _ w a r p . c
e n g i n e / g l / l t f a c e . c
#These are GL-specific
e n g i n e / g l / g l _ b a c k e n d . c
e n g i n e / g l / g l _ b l o o m . c
e n g i n e / g l / g l _ d r a w . c
e n g i n e / g l / g l _ r m a i n . c
e n g i n e / g l / g l _ r m i s c . c
e n g i n e / g l / g l _ r s u r f . c
e n g i n e / g l / g l _ s c r e e n . c
e n g i n e / g l / g l _ v i d c o m m o n . c
e n g i n e / g l / g l m o d _ d o o m . c
e n g i n e / v k / v k _ b a c k e n d . c
e n g i n e / v k / v k _ i n i t . c
)
SET_TARGET_PROPERTIES ( fteqw PROPERTIES COMPILE_DEFINITIONS "${FTE_DEFINES};${FTE_REVISON}" )
TARGET_LINK_LIBRARIES ( fteqw ${ FTE_LIBS } )
ADD_EXECUTABLE ( fteqw-sv
$ { F T E S V _ A R C H _ F I L E S }
$ { F T E _ C O M M O N _ F I L E S }
)
SET_TARGET_PROPERTIES ( fteqw-sv PROPERTIES COMPILE_DEFINITIONS "SERVERONLY;${FTESV_DEFINES};${FTE_REVISON}" )
TARGET_LINK_LIBRARIES ( fteqw-sv ${ FTESV_LIBS } )
ADD_EXECUTABLE ( fteqcc
e n g i n e / q c l i b / q c c t u i . c
e n g i n e / q c l i b / c o m p r o u t . c
e n g i n e / q c l i b / h a s h . c
e n g i n e / q c l i b / q c c _ c m d l i b . c
e n g i n e / q c l i b / q c c _ p r _ c o m p . c
e n g i n e / q c l i b / q c c _ p r _ l e x . c
e n g i n e / q c l i b / q c c m a i n . c
e n g i n e / q c l i b / q c d _ m a i n . c
)
TARGET_LINK_LIBRARIES ( fteqcc z m )
IF ( ${ WIN32 } )
ADD_EXECUTABLE ( fteqccgui WIN32
e n g i n e / q c l i b / q c c g u i . c
e n g i n e / q c l i b / q c c g u i s t u f f . c
e n g i n e / q c l i b / c o m p r o u t . c
e n g i n e / q c l i b / h a s h . c
e n g i n e / q c l i b / q c c _ c m d l i b . c
e n g i n e / q c l i b / q c c _ p r _ c o m p . c
e n g i n e / q c l i b / q c c _ p r _ l e x . c
e n g i n e / q c l i b / q c c m a i n . c
e n g i n e / q c l i b / d e c o m p . c
e n g i n e / q c l i b / p a c k a g e r . c
e n g i n e / q c l i b / q c d _ m a i n . c
)
TARGET_LINK_LIBRARIES ( fteqccgui z shlwapi ole32 comctl32 comdlg32 )
ENDIF ( )
#Quake Injector Alike plugin
ADD_LIBRARY ( qi MODULE
p l u g i n s / q v m _ a p i . c
p l u g i n s / p l u g i n . c
p l u g i n s / q i / q i . c
p l u g i n s / e m a i l n o t / m d 5 . c
p l u g i n s / j a b b e r / x m l . c
)
SET_TARGET_PROPERTIES ( qi PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN" )
SET_TARGET_PROPERTIES ( qi PROPERTIES PREFIX "fteplug_" )
#EzQuake Hud port plugin
ADD_LIBRARY ( ezhud MODULE
p l u g i n s / q v m _ a p i . c
p l u g i n s / p l u g i n . c
p l u g i n s / e z h u d / e z q u a k e i s m s . c
p l u g i n s / e z h u d / h u d . c
p l u g i n s / e z h u d / h u d _ c o m m o n . c
p l u g i n s / e z h u d / h u d _ e d i t o r . c
)
SET_TARGET_PROPERTIES ( ezhud PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN" )
SET_TARGET_PROPERTIES ( ezhud PROPERTIES PREFIX "fteplug_" )
#IRC client plugin
ADD_LIBRARY ( irc MODULE
p l u g i n s / q v m _ a p i . c
p l u g i n s / p l u g i n . c
p l u g i n s / i r c / i r c c l i e n t . c
)
SET_TARGET_PROPERTIES ( irc PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN" )
SET_TARGET_PROPERTIES ( irc PROPERTIES PREFIX "fteplug_" )
#XMPP/jabber client plugin
ADD_LIBRARY ( xmpp MODULE
p l u g i n s / q v m _ a p i . c
p l u g i n s / p l u g i n . c
p l u g i n s / j a b b e r / j a b b e r c l i e n t . c
p l u g i n s / j a b b e r / x m l . c
p l u g i n s / j a b b e r / j i n g l e . c
p l u g i n s / j a b b e r / s i f t . c
e n g i n e / c o m m o n / s h a 1 . c
p l u g i n s / e m a i l n o t / m d 5 . c
)
SET_TARGET_PROPERTIES ( xmpp PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN" )
SET_TARGET_PROPERTIES ( xmpp PROPERTIES PREFIX "fteplug_" )
#ffmpeg plugin
#cef plugin
#bullet plugin