-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
112 lines (96 loc) · 4.21 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
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
cmake_minimum_required(VERSION 3.16)
# Definitions
# add_compile_definitions(AX_PLATFORM_WINDOWS)
# add_compile_definitions(AX_BUILD_DISTRIBUTION)
# Project
project(Shit)
# C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# GLFW flags
set(GLFW_BUILD_DOCS OFF CACHE BOOL "No docs" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "No tests" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "No examples" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "No install" FORCE)
# BGFX flags
set(BGFX_AMALGAMATED ON CACHE BOOL "No amalgamated" FORCE)
set(BX_AMALGAMATED ON CACHE BOOL "No amalgamated" FORCE)
set(BGFX_BUILD_EXAMPLES OFF CACHE BOOL "No examples" FORCE)
set(BGFX_BUILD_TOOLS OFF CACHE BOOL "Tools off by default" FORCE)
set(BGFX_BUILD_TOOLS_BIN2C OFF CACHE BOOL "Shader to header compiler, fuck no baby" FORCE)
set(BGFX_BUILD_TOOLS_GEOMETRY OFF CACHE BOOL "Do not use" FORCE)
set(BGFX_BUILD_TOOLS_SHADER ON CACHE BOOL "Shader compiler" FORCE)
set(BGFX_BUILD_TOOLS_TEXTURE ON CACHE BOOL "Texture compiler" FORCE)
set(BGFX_CONFIG_MULTITHREADED ON CACHE BOOL "Use multithreading, YES SIR" FORCE)
set(BGFX_INSTALL OFF CACHE BOOL "No install" FORCE)
# ASSIMP flags
set(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "No DLL" FORCE)
set(ASSIMP_INSTALL OFF CACHE BOOL "No install" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "No tests" FORCE)
set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT OFF CACHE BOOL "No exporters" FORCE)
set(ASSIMP_NO_EXPORT ON CACHE BOOL "No exporters" FORCE)
set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT OFF CACHE BOOL "No all importers" FORCE)
set(ASSIMP_BUILD_FBX_IMPORTER ON CACHE BOOL "Enable FBX importer" FORCE)
set(ASSIMP_BUILD_COLLADA_IMPORTER ON CACHE BOOL "Enable COLLADA importer" FORCE)
set(ASSIMP_BUILD_GLTF_IMPORTER ON CACHE BOOL "Enable GLTF importer" FORCE)
# TinyGLTF flags
# set(TINYGLTF_HEADER_ONLY ON CACHE BOOL "" FORCE)
set(TINYGLTF_INSTALL OFF CACHE BOOL "" FORCE)
set(TINYGLTF_NO_EXTERNAL_IMAGE ON CACHE BOOL "" FORCE)
# OZZ flags
#set(ozz_build_tools OFF CACHE BOOL "No tools" FORCE)
#set(ozz_build_fbx OFF CACHE BOOL "No FBX" FORCE)
#set(ozz_build_gltf OFF CACHE BOOL "No GLTF" FORCE)
#set(ozz_build_samples OFF CACHE BOOL "No samples" FORCE)
#set(ozz_build_howtos OFF CACHE BOOL "No howto" FORCE)
#set(ozz_build_tests OFF CACHE BOOL "No tests" FORCE)
# Third party definitions
# add_compile_definitions(BX_CONFIG_DEBUG)
# Subdirectories (folders that have a CMakeLists.txt file)
add_subdirectory(External/glfw)
add_subdirectory(External/bgfx.cmake)
add_subdirectory(External/assimp)
#add_subdirectory(External/tinygltf)
# Executable
add_executable(
Shit
#Content/Metadata/Metadata.rc
Source/Main.cpp
# Rendering
Source/Texture.cpp
#Source/Shader.cpp
Source/Model.cpp
Source/Bone.cpp
Source/Animation.cpp
Source/Animator.cpp
Source/StaticModel.cpp
#Source/SkinnedModel.cpp
# Asset Managers
Source/ContentManagers/ContentManager.cpp
Source/ContentManagers/ShaderManager.cpp
Source/ContentManagers/UniformManager.cpp
Source/ContentManagers/ModelManager.cpp
Source/ContentManagers/TextureManager.cpp
Source/ContentManagers/BufferManager.cpp
# Misc
Source/Utility.cpp
)
# Properties
# On windows this removes the console and only shows the GLFW window
# set_target_properties(Shit PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup /SUBSYSTEM:WINDOWS")
# On GCC/Linux we can add the -mwindow flag to remove the console as well
# But game client will be windows only
# Include libraries
target_include_directories(Shit PUBLIC External/glfw/include)
target_include_directories(Shit PUBLIC External/SDL2/include)
target_include_directories(Shit PUBLIC External/glm/glm)
target_include_directories(Shit PUBLIC External/bgfx.cmake/bx/include)
target_include_directories(Shit PUBLIC External/bgfx.cmake/bimg/include)
target_include_directories(Shit PUBLIC External/bgfx.cmake/bgfx/include)
target_include_directories(Shit PUBLIC External/assimp)
# target_include_directories(Shit PUBLIC External/tinygltf)
# Link libraries
#target_link_libraries(Shit PRIVATE tinygltf)
target_link_libraries(Shit PRIVATE glfw bgfx bx assimp SDL2 SDL2main)
#target_link_libraries(Shit PRIVATE glfw bgfx bx assimp ozz_animation)