forked from Counter-Strike-16/OpenGoldSrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (35 loc) · 1.66 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
cmake_minimum_required(VERSION 2.8) # 3.6/3.8
project(OpenGoldSource)
include(cmake/InputFilesList.cmake)
include(cmake/MSVCRuntime.cmake)
include(cmake/WinXPSupport.cmake)
# Needs static CRT to avoid alloc issues.
set( MSVC_RUNTIME "static" )
configure_msvc_runtime()
# Specify intermediate directory (for building purposes)
#set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build/cmake)
# Specify output directory (for compiled binaries)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/cmake)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/cmake)
# Set additional paths to search for cmake modules
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
# We want shared libraries (and modules) without any prefix in name
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_MODULE_PREFIX "")
# Set flags for C code compilation
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -w")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -O3")
# Set flags for C++ code compilation
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -w")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3")
set(SRC_DIR ${CMAKE_SOURCE_DIR}/goldsrc)
# Add dependencies directory
add_subdirectory(external)
# Add engine root directory
add_subdirectory(goldsrc)