forked from cufechs/ShiEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (78 loc) · 3.49 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
cmake_minimum_required(VERSION 3.0.0) # Selects the minimum version of CMake required to run this file
project(GFX-LAB VERSION 0.1.0) # Here we select the project name and version
# Here we select C++17 with all the standards required and all compiler-specific extensions disabled
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# These are the options we select for building GLFW as a library
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) # Don't build Documentation
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) # Don't build Tests
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # Don't build Examples
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) # Don't build Installation Information
set(GLFW_USE_HYBRID_HPG ON CACHE BOOL "" FORCE) # Add variables to use High Performance Graphics Card if available
add_subdirectory(vendor/glfw) # Build the GLFW project to use later as a library
# A variable with all the source files of GLAD
set(GLAD_SOURCE vendor/glad/src/gl.c)
# A variables with all the source files of Dear ImGui
set(IMGUI_SOURCES
vendor/imgui/imgui.cpp
vendor/imgui/imgui_demo.cpp
vendor/imgui/imgui_draw.cpp
vendor/imgui/imgui_widgets.cpp
vendor/imgui/imgui_impl/imgui_impl_glfw.cpp
vendor/imgui/imgui_impl/imgui_impl_opengl3.cpp
)
# Combine all vendor source files together into a single variable
set(VENDOR_SOURCES ${GLAD_SOURCE} ${IMGUI_SOURCES})
# A variable with all our source files that are common between executable targets (examples)
set(COMMON_SOURCES
source/common/application.cpp
source/common/Shader.cpp
source/common/GameState.cpp
source/common/GameState.h
source/common/GameStateManger.cpp
source/common/GameStateManger.h
source/common/GameObject.cpp
source/common/GameObject.h
source/common/GameObjectComponent.cpp
source/common/GameObjectComponent.h
source/common/Mesh.h
source/common/MeshRenderer.h
source/common/MeshRenderer.cpp
source/common/colors.h
source/common/common-vertex-attributes.hpp
source/common/common-vertex-types.hpp
source/common/vertex-attributes.hpp
source/common/Camera.h
source/common/Camera.cpp
source/common/CameraController.h
source/examples/States.h
source/common/Globals/Global.h
source/common/LoadState.h
source/common/texture-utils.cpp
source/common/texture-utils.h
source/common/data-types.h
source/common/Light.h
source/common/Material.h
source/common/Texture2D.cpp
source/common/Mesh.cpp
source/common/Texture2D.h
source/common/Globals/Global_vars.h
source/common/EnemyMovement.h
source/common/Level2.h
source/common/Sampler.cpp source/common/Sampler.h
source/common/RenderState.h source/common/BoxCollider.cpp source/common/BoxCollider.h)
# Define the directories in which to search for the included headers
include_directories(
source/common
vendor/glfw/include
vendor/glad/include
vendor/glm
vendor/imgui
vendor/utils
)
# For each example, we add an executable target
# Each target compiles one example source file and the common & vendor source files
# Then we link GLFW with each target
add_executable(Main source/examples/Main.cpp ${COMMON_SOURCES} ${VENDOR_SOURCES})
target_link_libraries(Main glfw)