forked from Katana-Steel/lithtech
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
157 lines (133 loc) · 5.08 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
cmake_minimum_required(VERSION 3.1)
project(Lithtech)
option(BUILD_ENGINE "Build engine" ON)
option(BUILD_NOLF2 "Build No One Lives Forever 2 game code" ON)
option(BUILD_TRON "Build Tron 2.0 game code" OFF)
option(BUILD_BLOOD2 "Build Blood II game code" OFF)
option(BUILD_FEAR "Build F.E.A.R. game code" OFF)
option(BUILD_NOLF "Build No One Lives Forever game code" OFF)
option(BUILD_SHOGO "Build Shogo game code" OFF)
option(BUILD_TOOLS "Build tools" OFF)
if(WIN32)
option(ENABLE_D3D "Enable Direct3D" ON)
option(ENABLE_DIRECTX "Enable DirectX" ON)
option(ENABLE_DIRECTSHOW "Enable DirectShow" ON)
else(WIN32)
option(ENABLE_OPENGL "Enable OpenGL 3.3" ON)
option(ENABLE_VULKAN "Enable Vulkan" ON)
endif(WIN32)
option(USE_INTERNAL_ZLIB "Use bundled zlib" ON) # eventually want default to be OFF
option(USE_INTERNAL_FREETYPE "Use bundled freetype" ON) # eventually want default to be OFF
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/OUT")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED 11)
if(ENABLE_D3D)
add_definitions(-D__D3D -D__D3DREND)
endif(ENABLE_D3D)
if(WIN32)
add_definitions(-D_WINDOWS)
else(WIN32)
add_definitions(-D_LINUX -D__LINUX)
set(LINUX 1)
endif(WIN32)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif(MSVC)
if(DEBUG)
add_definitions(-D_DEBUG)
else(DEBUG)
add_definitions(-D_FINAL)
endif(DEBUG)
if(USE_INTERNAL_ZLIB)
#set zlib vars
add_subdirectory(libs/zlib) # LIB_ZLib
else(USE_INTERNAL_ZLIB)
find_package(ZLIB)
endif(USE_INTERNAL_ZLIB)
# move to Lib_UI CMakeLists.txt?
if(USE_INTERNAL_FREETYPE)
#set freetype vars
else(USE_INTERNAL_FREETYPE)
find_package(Freetype)
endif(USE_INTERNAL_FREETYPE)
add_subdirectory(libs/lith) # LIB_Lith
add_subdirectory(libs/stdlith) # LIB_StdLith
add_subdirectory(libs/ltmem) # LIB_LTMem
add_subdirectory(libs/rezmgr) # LIB_RezMgr
if(LINUX)
add_subdirectory(libs/DynRes)
add_subdirectory(json)
endif(LINUX)
if(BUILD_ENGINE)
add_subdirectory(runtime/ui) # LIB_UI
add_subdirectory(runtime/info) # LIB_Info
add_subdirectory(runtime/sound) # LIB_ILTSound
add_subdirectory(runtime/server) # DLL_Server
add_subdirectory(runtime/client) # EXE_Lithtech
if(WIN32)
if(ENABLE_D3D)
add_subdirectory(runtime/render_a/src/sys/d3d) # LIB_D3DRender
endif(ENABLE_D3D)
if(ENABLE_DIRECTX)
add_subdirectory(runtime/sound/src/sys/s_dx8) # DLL_SndDrvDX8
endif(ENABLE_DIRECTX)
if(ENABLE_DIRECTSHOW)
add_subdirectory(libs/dshow) # LIB_DShow
endif(ENABLE_DIRECTSHOW)
add_subdirectory(runtime/winbuild/ltmsg) # DLL_LTMsg
endif(WIN32)
endif(BUILD_ENGINE)
if(BUILD_NOLF2)
add_subdirectory(libs/MFCStub) # LIB_MFCStub
add_subdirectory(libs/ButeMgr) # LIB_ButeMgr
add_subdirectory(libs/CryptMgr) # LIB_CryptMgr
add_subdirectory(libs/RegMgr) # LIB_RegMgr
add_subdirectory(libs/LTGUIMgr) # LIB_LTGUIMgr
add_subdirectory(libs/ServerDir) # ServerDir
add_subdirectory(libs/WONAPI) # LIB_WONAPI
add_subdirectory(NOLF2/ClientFxDLL) # ClientFXDLL
add_subdirectory(NOLF2/ClientRes/TO2) # ClientRes
add_subdirectory(NOLF2/ClientShellDLL/TO2) # ClientShellDLL
add_subdirectory(NOLF2/ObjectDLL/TO2) # ObjectDLL
add_subdirectory(NOLF2/ServerRes/TO2) # ServerRes
endif(BUILD_NOLF2)
if(BUILD_FEAR)
if(NOT BUILD_NOLF2)
add_subdirectory(libs/MFCStub) # LIB_MFCStub
add_subdirectory(libs/ButeMgr) # LIB_ButeMgr
add_subdirectory(libs/CryptMgr) # LIB_CryptMgr
add_subdirectory(libs/RegMgr) # LIB_RegMgr
add_subdirectory(libs/LTGUIMgr) # LIB_LTGUIMgr
add_subdirectory(libs/ServerDir) # ServerDir
add_subdirectory(libs/WONAPI) # LIB_WONAPI
endif(NOT BUILD_NOLF2)
add_subdirectory(FEAR/ClientFxDLL) # ClientFXDLL
# add_subdirectory(NOLF2/ClientRes/TO2) # ClientRes
add_subdirectory(FEAR/ClientShellDLL) # ClientShellDLL
# add_subdirectory(NOLF2/ObjectDLL/TO2) # ObjectDLL
# add_subdirectory(NOLF2/ServerRes/TO2) # ServerRes
endif(BUILD_FEAR)
if(BUILD_TRON)
if(NOT BUILD_NOLF2)
add_subdirectory(libs/MFCStub)
add_subdirectory(libs/ButeMgr)
add_subdirectory(libs/CryptMgr)
add_subdirectory(libs/RegMgr)
add_subdirectory(libs/LTGUIMgr)
add_subdirectory(libs/ServerDir)
add_subdirectory(libs/WONAPI)
add_subdirectory(NOLF2/ClientFxDLL) # ClientFXDLL
endif(NOT BUILD_NOLF2)
add_subdirectory(NOLF2/ClientRes/TRON) # ClientRes
add_subdirectory(NOLF2/ClientShellDLL/TRON) # ClientShellDLL
add_subdirectory(NOLF2/ObjectDLL/TRON) # ObjectDLL
add_subdirectory(NOLF2/ServerRes/TRON) # ServerRes
endif(BUILD_TRON)
if(BUILD_TOOLS)
add_subdirectory(tools/DtxView) # TOOLS_DtxView
add_subdirectory(tools/LithRez) # TOOLS_LithRez
endif(BUILD_TOOLS)
add_subdirectory(tests/RegMgr)
add_subdirectory(tests/CShell)
add_subdirectory(tests/DynRes)
add_subdirectory(tests/DynResDLL)