forked from KranX/Vangers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
95 lines (76 loc) · 2.1 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# root
PROJECT(vangers)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
# modules
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# options
OPTION(RUSSIAN_VERSION "Build russian version" ON)
OPTION(BINARY_SCRIPT "Use binary script for interface" ON)
OPTION(WITH_OPENGL "Use experimental OpenGL renderer" OFF)
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(RUSSIAN_VERSION)
ADD_DEFINITIONS(-DRUSSIAN_VERSION)
ENDIF(RUSSIAN_VERSION)
IF(BINARY_SCRIPT)
ADD_DEFINITIONS(-D_BINARY_SCRIPT_)
ENDIF(BINARY_SCRIPT)
IF(WITH_OPENGL)
FIND_PACKAGE(OpenGL REQUIRED)
ADD_DEFINITIONS(-DWITH_OPENGL)
ENDIF(WITH_OPENGL)
IF(ACTINT)
ADD_DEFINITIONS(-DACTINT)
ENDIF(ACTINT)
IF(DIAGEN_TEST)
ADD_DEFINITIONS(-DDIAGEN_TEST)
ENDIF(DIAGEN_TEST)
IF(STEAM)
ADD_DEFINITIONS(-D_STEAM_API_)
SET(STEAM_INCLUDE_DIR /c/projects/sdk/public)
SET(STEAM_LIBS
/c/projects/sdk/redistributable_bin/steam_api.dll
)
ENDIF(STEAM)
# globals
INCLUDE_DIRECTORIES(SYSTEM
${ZLIB_INCLUDE_DIR}
${SDL2_INCLUDE_DIR}
${SDL2_NET_INCLUDE_DIR}
${FFMPEG_INCLUDE_DIRS}
${CLUNK_INCLUDE_DIR}
${OGG_INCLUDE_DIR}
${VORBIS_INCLUDE_DIR}
${VORBISFILE_INCLUDE_DIR}
${STEAM_INCLUDE_DIR}
)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -msse2")
# For modern gcc
add_definitions(-D_USE_MATH_DEFINES)
IF (NOT MINGW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize -ffast-math")
ENDIF (NOT MINGW)
# subdirs
ADD_SUBDIRECTORY("src")
ADD_SUBDIRECTORY("lib/xgraph")
ADD_SUBDIRECTORY("lib/xsound")
ADD_SUBDIRECTORY("lib/xtool")
ADD_SUBDIRECTORY("lib/utils")