2019-11-24 20:45:15 -08:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
cmake_policy(SET CMP0046 NEW)
|
|
|
|
cmake_policy(SET CMP0063 NEW)
|
|
|
|
cmake_policy(SET CMP0071 NEW)
|
|
|
|
|
|
|
|
project(agw-quake C)
|
|
|
|
|
|
|
|
if(NOT MSVC)
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Werror")
|
|
|
|
endif()
|
|
|
|
|
2019-11-24 22:05:46 -08:00
|
|
|
find_package(OpenGL REQUIRED)
|
2019-11-24 20:45:15 -08:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
2019-11-24 22:05:46 -08:00
|
|
|
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2>=2.0.0)
|
|
|
|
|
|
|
|
pkg_check_modules(FLAC IMPORTED_TARGET flac>=1.3.3)
|
|
|
|
pkg_check_modules(Vorbis IMPORTED_TARGET vorbis>=1.3.6
|
|
|
|
vorbisfile>=1.3.6
|
|
|
|
ogg>=1.3.4)
|
|
|
|
pkg_check_modules(Opus IMPORTED_TARGET opus>=1.3.1
|
|
|
|
opusfile>=0.11
|
|
|
|
ogg>=1.3.4)
|
|
|
|
pkg_check_modules(MikMod IMPORTED_TARGET libmikmod>=3.3.11)
|
2019-11-24 20:45:15 -08:00
|
|
|
|
|
|
|
add_executable(quake WIN32
|
|
|
|
source/anorm_dots.h
|
|
|
|
source/anorms.h
|
|
|
|
source/arch_def.h
|
|
|
|
source/bgmusic.c
|
|
|
|
source/bgmusic.h
|
|
|
|
source/bspfile.h
|
|
|
|
source/cd_sdl.c
|
|
|
|
source/cdaudio.h
|
|
|
|
source/cfgfile.c
|
|
|
|
source/cfgfile.h
|
|
|
|
source/chase.c
|
|
|
|
source/cl_demo.c
|
|
|
|
source/cl_input.c
|
|
|
|
source/cl_main.c
|
|
|
|
source/cl_parse.c
|
|
|
|
source/cl_tent.c
|
|
|
|
source/client.h
|
|
|
|
source/cmd.c
|
|
|
|
source/cmd.h
|
|
|
|
source/common.c
|
|
|
|
source/common.h
|
|
|
|
source/console.c
|
|
|
|
source/console.h
|
|
|
|
source/crc.c
|
|
|
|
source/crc.h
|
|
|
|
source/cvar.c
|
|
|
|
source/cvar.h
|
|
|
|
source/draw.h
|
|
|
|
source/filenames.h
|
|
|
|
source/gl_draw.c
|
|
|
|
source/gl_fog.c
|
|
|
|
source/gl_mesh.c
|
|
|
|
source/gl_model.c
|
|
|
|
source/gl_model.h
|
|
|
|
source/gl_refrag.c
|
|
|
|
source/gl_rlight.c
|
|
|
|
source/gl_rmain.c
|
|
|
|
source/gl_rmisc.c
|
|
|
|
source/gl_screen.c
|
|
|
|
source/gl_sky.c
|
|
|
|
source/gl_texmgr.c
|
|
|
|
source/gl_texmgr.h
|
|
|
|
source/gl_vidsdl.c
|
|
|
|
source/gl_warp.c
|
|
|
|
source/gl_warp_sin.h
|
|
|
|
source/glquake.h
|
|
|
|
source/host.c
|
|
|
|
source/host_cmd.c
|
|
|
|
source/image.c
|
|
|
|
source/image.h
|
|
|
|
source/in_sdl.c
|
|
|
|
source/input.h
|
|
|
|
source/keys.c
|
|
|
|
source/keys.h
|
|
|
|
source/lodepng.h
|
|
|
|
source/main_sdl.c
|
|
|
|
source/mathlib.c
|
|
|
|
source/mathlib.h
|
|
|
|
source/menu.c
|
|
|
|
source/menu.h
|
|
|
|
source/modelgen.h
|
|
|
|
source/net.h
|
|
|
|
source/net_bsd.c
|
|
|
|
source/net_defs.h
|
|
|
|
source/net_dgrm.c
|
|
|
|
source/net_dgrm.h
|
|
|
|
source/net_loop.c
|
|
|
|
source/net_loop.h
|
|
|
|
source/net_main.c
|
|
|
|
source/net_sys.h
|
|
|
|
source/net_udp.c
|
|
|
|
source/net_udp.h
|
|
|
|
source/pl_linux.c
|
|
|
|
source/platform.h
|
|
|
|
source/pr_cmds.c
|
|
|
|
source/pr_comp.h
|
|
|
|
source/pr_edict.c
|
|
|
|
source/pr_exec.c
|
|
|
|
source/progdefs.h
|
|
|
|
source/progs.h
|
|
|
|
source/protocol.h
|
|
|
|
source/q_ctype.h
|
|
|
|
source/q_sound.h
|
|
|
|
source/q_stdinc.h
|
|
|
|
source/qs_bmp.h
|
|
|
|
source/quakedef.h
|
|
|
|
source/r_alias.c
|
|
|
|
source/r_brush.c
|
|
|
|
source/r_part.c
|
|
|
|
source/r_sprite.c
|
|
|
|
source/r_world.c
|
|
|
|
source/render.h
|
|
|
|
source/resource.h
|
|
|
|
source/sbar.c
|
|
|
|
source/sbar.h
|
|
|
|
source/screen.h
|
|
|
|
source/server.h
|
|
|
|
source/snd_codec.c
|
|
|
|
source/snd_codec.h
|
|
|
|
source/snd_codeci.h
|
|
|
|
source/snd_dma.c
|
|
|
|
source/snd_flac.c
|
|
|
|
source/snd_flac.h
|
|
|
|
source/snd_mem.c
|
|
|
|
source/snd_mikmod.c
|
|
|
|
source/snd_mikmod.h
|
|
|
|
source/snd_mix.c
|
|
|
|
source/snd_mp3.c
|
|
|
|
source/snd_mp3.h
|
|
|
|
source/snd_mpg123.c
|
|
|
|
source/snd_opus.c
|
|
|
|
source/snd_opus.h
|
|
|
|
source/snd_sdl.c
|
|
|
|
source/snd_umx.c
|
|
|
|
source/snd_umx.h
|
|
|
|
source/snd_vorbis.c
|
|
|
|
source/snd_vorbis.h
|
|
|
|
source/snd_wave.c
|
|
|
|
source/snd_wave.h
|
|
|
|
source/snd_xmp.c
|
|
|
|
source/snd_xmp.h
|
|
|
|
source/spritegn.h
|
|
|
|
source/stb_image_write.h
|
|
|
|
source/strl_fn.h
|
|
|
|
source/strlcat.c
|
|
|
|
source/strlcpy.c
|
|
|
|
source/sv_main.c
|
|
|
|
source/sv_move.c
|
|
|
|
source/sv_phys.c
|
|
|
|
source/sv_user.c
|
|
|
|
source/sys.h
|
|
|
|
source/sys_sdl_unix.c
|
|
|
|
source/vid.h
|
|
|
|
source/view.c
|
|
|
|
source/view.h
|
|
|
|
source/wad.c
|
|
|
|
source/wad.h
|
|
|
|
source/world.c
|
|
|
|
source/world.h
|
|
|
|
source/wsaerror.h
|
|
|
|
source/zone.c
|
|
|
|
source/zone.h)
|
|
|
|
|
2019-11-24 22:05:46 -08:00
|
|
|
function(agw_checked_library define library)
|
|
|
|
target_compile_definitions(quake PUBLIC -D${define}=1)
|
|
|
|
target_link_libraries(quake ${library})
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
agw_checked_library(USE_CODEC_FLAC PkgConfig::FLAC)
|
|
|
|
agw_checked_library(USE_CODEC_VORBIS PkgConfig::Vorbis)
|
|
|
|
agw_checked_library(USE_CODEC_OPUS PkgConfig::Opus)
|
|
|
|
agw_checked_library(USE_CODEC_MikMod PkgConfig::MikMod)
|
2019-11-24 20:45:15 -08:00
|
|
|
|
2019-11-24 22:05:46 -08:00
|
|
|
target_link_libraries(quake m OpenGL::GL PkgConfig::SDL2)
|