forked from TheSuperHackers/GeneralsGameCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (63 loc) · 2.27 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
cmake_minimum_required(VERSION 3.25)
# Use packagename_ROOT for FindPackage.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# Disable default MSVC setting CRT type so we can set it ourselves.
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
# Disable default MSVC warning level so we can set it ourselves.
if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()
# Allow specifying MSVC debug configurations.
#if(POLICY CMP0141)
# cmake_policy(SET CMP0141 NEW)
#endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(FeatureSummary)
include(CMakeDependentOption)
# We don't support in tree builds, so help people make the right choice.
if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
endif()
# Top level project, doesn't really affect anything.
project(genzh LANGUAGES C CXX)
# This file handles extra settings wanted/needed for different compilers.
include(cmake/compilers.cmake)
include(FetchContent)
# Find/Add build dependencies and stubs shared by all projects
if((WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
include(cmake/miles.cmake)
include(cmake/bink.cmake)
if (IS_VS6_BUILD)
include(cmake/stlport.cmake)
else()
add_library(stlport INTERFACE) # Do not use stlport
endif()
include(cmake/dx8.cmake)
include(cmake/dbghelp.cmake)
endif()
include(cmake/config.cmake)
include(cmake/gamespy.cmake)
include(cmake/lzhl.cmake)
include(cmake/zlib.cmake)
add_subdirectory(Dependencies/Benchmark)
if (IS_VS6_BUILD)
# The original max sdk does not compile against a modern compiler.
# If there is a desire to make this work, then a fixed max sdk needs to be created.
add_subdirectory(Dependencies/MaxSDK)
endif()
add_subdirectory(Dependencies/SafeDisc)
add_subdirectory(Dependencies/Utility)
add_subdirectory(resources)
# Add main build targets
if(GENZH_BUILD_ZEROHOUR)
add_subdirectory(GeneralsMD)
endif()
if(GENZH_BUILD_GENERALS)
add_subdirectory(Generals)
endif()
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")