-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
92 lines (85 loc) · 2.89 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
cmake_minimum_required(VERSION 3.0.0)
project(gameengine)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES
src/engineTester/MainGameLoop.cpp
src/entities/Camera.cpp
src/entities/Camera.h
src/entities/Entity.cpp
src/entities/Entity.h
src/entities/Light.cpp
src/entities/Light.h
src/entities/Player.cpp
src/entities/Player.h
src/guis/GuiRenderer.cpp
src/guis/GuiRenderer.h
src/guis/GuiShader.cpp
src/guis/GuiShader.h
src/guis/GuiTexture.cpp
src/guis/GuiTexture.h
src/models/RawModel.cpp
src/models/RawModel.h
src/models/TexturedModel.cpp
src/models/TexturedModel.h
src/renderEngine/DisplayManager.cpp
src/renderEngine/DisplayManager.h
src/renderEngine/EntityRenderer.cpp
src/renderEngine/EntityRenderer.h
src/renderEngine/Loader.cpp
src/renderEngine/Loader.h
src/renderEngine/MasterRenderer.cpp
src/renderEngine/MasterRenderer.h
src/renderEngine/OBJLoader.cpp
src/renderEngine/OBJLoader.h
src/renderEngine/TerrainRenderer.cpp
src/renderEngine/TerrainRenderer.h
src/shaders/ShaderProgram.cpp
src/shaders/ShaderProgram.h
src/shaders/StaticShader.cpp
src/shaders/StaticShader.h
src/shaders/TerrainShader.cpp
src/shaders/TerrainShader.h
src/skybox/SkyboxRenderer.cpp
src/skybox/SkyboxRenderer.h
src/skybox/SkyboxShader.cpp
src/skybox/SkyboxShader.h
src/terrains/Terrain.cpp
src/terrains/Terrain.h
src/textures/ModelTexture.cpp
src/textures/ModelTexture.h
src/textures/TerrainTexture.cpp
src/textures/TerrainTexture.h
src/textures/TerrainTexturePack.cpp
src/textures/TerrainTexturePack.h
src/textures/TextureData.cpp
src/textures/TextureData.h
src/textures/TextureLoader.cpp
src/textures/TextureLoader.h
src/toolbox/Keyboard.cpp
src/toolbox/Keyboard.h
src/toolbox/Maths.cpp
src/toolbox/Maths.h)
add_executable(gameengine ${SOURCE_FILES})
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} )
target_link_libraries(gameengine ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} SDL2 SDL2_ttf SDL2_image)
#target_link_libraries (ES2 SDL2 SDL2_ttf SDL2_image m)
add_custom_command(TARGET gameengine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/res $<TARGET_FILE_DIR:gameengine>/res)
set( SHADERS
src/shaders/vertexShader.txt
src/shaders/fragmentShader.txt
src/shaders/terrainVertexShader.txt
src/shaders/terrainFragmentShader.txt
src/skybox/skyboxVertexShader.txt
src/skybox/skyboxFragmentShader.txt
src/guis/guiVertexShader.txt
src/guis/guiFragmentShader.txt
)
foreach(item IN LISTS SHADERS)
add_custom_command(TARGET gameengine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/${item} $<TARGET_FILE_DIR:gameengine>/${item})
endforeach()