forked from KranX/Vangers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (60 loc) · 1.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version")
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
# root
PROJECT(vangers)
# modules
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# options
OPTION(BINARY_SCRIPT "Use binary script for interface" ON)
OPTION(DIAGEN_TEST "Dialog generator and test subsystem" OFF)
# hide optons
OPTION(ACTINT "Actint user interface in road game" ON)
SET(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo")
IF(MINGW)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
ENDIF()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# depends
FIND_PACKAGE(SDL2 REQUIRED)
FIND_PACKAGE(SDL2_net REQUIRED)
FIND_PACKAGE(Ogg REQUIRED)
FIND_PACKAGE(Vorbis REQUIRED)
FIND_PACKAGE(VorbisFile REQUIRED)
FIND_PACKAGE(Clunk REQUIRED)
FIND_PACKAGE(FFMPEG REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
set(WINDOWS_RES "../vangers.res")
IF(BINARY_SCRIPT)
ADD_DEFINITIONS(-D_BINARY_SCRIPT_)
ENDIF(BINARY_SCRIPT)
IF(ACTINT)
ADD_DEFINITIONS(-DACTINT)
ENDIF(ACTINT)
IF(DIAGEN_TEST)
ADD_DEFINITIONS(-DDIAGEN_TEST)
ENDIF(DIAGEN_TEST)
# globals
INCLUDE_DIRECTORIES(SYSTEM
${ZLIB_INCLUDE_DIR}
${SDL2_INCLUDE_DIR}
${SDL2_NET_INCLUDE_DIRS}
${FFMPEG_INCLUDE_DIRS}
${CLUNK_INCLUDE_DIR}
${OGG_INCLUDE_DIR}
${VORBIS_INCLUDE_DIR}
${VORBISFILE_INCLUDE_DIR}
${STEAM_INCLUDE_DIR}
)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -msse2 -ftree-vectorize -ffast-math")
# For modern gcc
add_definitions(-D_USE_MATH_DEFINES)
# subdirs
ADD_SUBDIRECTORY("src")
ADD_SUBDIRECTORY("lib/xgraph")
ADD_SUBDIRECTORY("lib/xsound")
ADD_SUBDIRECTORY("lib/xtool")
ADD_SUBDIRECTORY("lib/utils")
ADD_SUBDIRECTORY("server")