-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
49 lines (42 loc) · 2.28 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
cmake_minimum_required(VERSION 3.13.0 FATAL_ERROR)
################################################################################
# Require out-of-source builds
################################################################################
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.")
endif()
################################################################################
# Build Options
################################################################################
option(VoidEngine_Build_Standalone "Include sample project in game project" ON)
option(VoidEngine_Enable_Sample_Project "Include sample project in game project" OFF)
################################################################################
# Set build-configuration types
################################################################################
set(CMAKE_CONFIGURATION_TYPES
"Debug"
"Release"
CACHE STRING "" FORCE
)
################################################################################
# Allow cmake to generate Solution Folders
################################################################################
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
# Set project-wide C++ compile flags
################################################################################
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_compile_options("$<$<CONFIG:RELEASE>:/GL>")
add_compile_options("$<$<CONFIG:RELEASE>:/Ot>")
add_link_options("$<$<CONFIG:RELEASE>:/LTCG>")
################################################################################
# Set project root dir
################################################################################
set(VoidEngine_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
################################################################################
# Include dependencies and engine modules
################################################################################
add_subdirectory(Dependencies)
add_subdirectory(VoidEngine)