-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
112 lines (90 loc) · 5.26 KB
/
CMakeLists.txt
File metadata and controls
112 lines (90 loc) · 5.26 KB
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
################################################################################
# Author: Joshua Shlemmer
# Copyright 2017, DigiPen Institute of Technology
################################################################################
################################################################################
# Set required version of cmake and any version specific policies
################################################################################
cmake_minimum_required(VERSION 3.25.1 FATAL_ERROR)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo Production)
################################################################################
# Declare project(s) and set used languages
################################################################################
project(Zero CXX)
################################################################################
# Do platform specific checks for chunks of the library paths
################################################################################
## windows libraries
#if( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
# set(platform Windows)
# # 64 bit windows libraries
# if( ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
# message(FATAL_ERROR "64bit windows is currently not supported.")
# # 32 bit windows libraries
# else()
# set(bit x86)
# endif()
## non-windows libraries
#else()
# message(FATAL_ERROR "no other platforms are currently supported besides windows. Current Sys: ${CMAKE_SYSTEM_NAME}")
#endif()
################################################################################
# Set up global variables
################################################################################
#paths
set(cmake_include_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(cmake_utilities_dir ${cmake_include_dir}/Utilities)
set(cmake_os_dir ${cmake_include_dir}/OS)
set(cmake_flags_dir ${cmake_include_dir}/CommonFlags)
set(cmake_config_dir ${cmake_include_dir}/Configuration)
set(cmake_compiler_dir ${cmake_include_dir}/Compiler)
set(ZERO_HOSTOS ${CMAKE_HOST_SYSTEM_NAME})
message("ZERO_HOSTOS: ${ZERO_HOSTOS}\n")
set(ZERO_CORE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(ZERO_CODE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Code)
message("CorePath: ${ZERO_CORE_PATH}\n")
set(ZERO_BUILD_OUT ${ZERO_CORE_PATH}/BuildOutput)
set(ZERO_SUPPORTED_CONFIGS $<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>)
set(ZERO_INTERMEDIATE_DIR ${ZERO_BUILD_OUT}/Int/${ZERO_SUPPORTED_CONFIGS})
set(ZERO_UNIT_TEST_DIR ${ZERO_CODE_PATH}/UnitTests)
################################################################################
# Define any user options
################################################################################
#option(ZERO_GENERATE_WITH_UNIT_TESTS "If set to 'ON', project will be generated with the unit tests included." OFF)
#option(ZERO_GENERATE_SPIRV_PROJECTS "If set to 'ON', spirv tools projects will be created. Allows static linking or generation of dll for tools." ON)
#option(ZERO_USE_SPIRV_SHARED_LIBRARY "If set to 'ON', project will link against a dll of spirv (allows release dll in debug mode)." OFF)
#if(NOT ZERO_GENERATE_SPIRV_PROJECTS AND NOT ZERO_USE_SPIRV_SHARED_LIBRARY)
# message(FATAL_ERROR "spirv project cannot be statically linked without also generating the spirv projects.")
#endif()
option(ZERO_EXCEPTIONS "Enable exception throwing/catching" ON)
if (ZERO_EXCEPTIONS)
add_definitions(-DZERO_EXCEPTIONS)
endif()
################################################################################
# Define any platform options
################################################################################
include(${cmake_include_dir}/Platform_Options.cmake)
set(ZERO_PLATFORM_DATA ${ZERO_CORE_PATH}/PlatformData/${ZERO_PLATFORM})
set(ZERO_LIBRARY_DIR ${ZERO_BUILD_OUT}/Out/${configuration}/${ZERO_SUPPORTED_CONFIGS})
set(ZERO_BINARY_DIR ${ZERO_BUILD_OUT}/Out/${configuration}/${ZERO_SUPPORTED_CONFIGS})
################################################################################
# Path for finding external CMake modules
################################################################################
set(CMAKE_MODULE_PATH "${Source_Root}/cmake/modules/")
################################################################################
# Includes
################################################################################
include(${cmake_utilities_dir}/zero_source_group.cmake)
include(${cmake_utilities_dir}/Zero_Mulitarget_Functions.cmake)
include(${cmake_utilities_dir}/Zero_Custom_Commands.cmake)
include(${cmake_utilities_dir}/Zero_Common_Helpers.cmake)
################################################################################
# Separate Projects into folders for IDEs.
################################################################################
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
# Call CMakeLists.txt in source folders, adding them to the project non-globally
################################################################################
add_subdirectory(Code)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ZeroEditor)