-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
68 lines (61 loc) · 2.17 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
###########################################
# Top-level of the modern vulkan engine #
###########################################
cmake_minimum_required (VERSION 3.8)
project ("Modern Vulkan")
set (CMAKE_CXX_STANDARD 20)
add_definitions(-DUNICODE -D_UNICODE -UNICODE)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
#find the CPU architecture type.
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "X86")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPU_ARCHITECTURE "x64")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CPU_ARCHITECTURE "x86")
endif()
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPU_ARCHITECTURE "x64")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CPU_ARCHITECTURE "x86")
endif()
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPU_ARCHITECTURE "arm64")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CPU_ARCHITECTURE "arm")
endif()
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
else()
message(FATAL_ERROR "CPU Architecture not supported, architecture of this PC: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_compile_definitions(PUBLIC _64BIT)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_compile_definitions(PUBLIC _32BIT)
endif()
#compile Definitions.
if (WIN32)
add_compile_definitions(PUBLIC _WIN32)
elseif(UNIX)
add_compile_definitions(PUBLIC _LINUX)
endif ()
if (CMAKE_BUILD_TYPE MATCHES Debug)
message("DEBUGGING BUILD SELECTED")
add_compile_definitions(PUBLIC _DEBUG)
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message("RELEASE BUILD SELECTED")
add_compile_definitions(PUBLIC _RELEASE)
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message("RELEASE WITH DEBUG BUILD SELECTED")
add_compile_definitions(PUBLIC _RELEASE)
else()
message(FATAL_ERROR "UNKNOWN BUILD TYPE")
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_subdirectory ("lib")
add_subdirectory ("src")
add_subdirectory ("resources")
message(STATUS "Building binaries at")
message(STATUS ${CMAKE_BINARY_DIR})