-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
104 lines (84 loc) · 2.8 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
cmake_minimum_required(VERSION 2.8)
project(UtH-Engine CXX)
set(INCLUDE_DIRS include/
ext/include/
ext/include/freetype_include/
vs2013/TestProject/include)
include_directories(${INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
add_library(platform STATIC
src/Platform/Graphics.cpp
src/Platform/OGLCheck.cpp
src/Platform/HiResTimer.cpp
src/Platform/Window.cpp
src/Platform/Common/FileReader.cpp
src/Platform/Common/CommonWindowImpl.cpp
src/Platform/Input.cpp
src/Platform/Common/InputTouch.cpp
src/Platform/Common/InputMouse.cpp
src/Platform/Common/InputKeyboard.cpp
src/Platform/Common/InputCommon.cpp
src/Platform/Common/InputBase.cpp)
add_library(core STATIC
src/Core/Shader.cpp
src/Core/VertexBuffer.cpp)
target_link_libraries(core platform)
add_library(tinyxml2 STATIC
${CMAKE_SOURCE_DIR}/ext/lib/tinyxml2/src/tinyxml2.cpp)
add_library(resources STATIC
src/Resources/ResourceManager.cpp
src/Resources/Image.cpp
src/Resources/SoundBuffer.cpp
src/Resources/Font.cpp)
target_link_libraries(resources tinyxml2)
add_library(audio STATIC
src/Audio/SoundDevice.cpp
src/Audio/Sound.cpp)
#target_link_libraries(audio resources)
add_library(renderer STATIC
src/Renderer/Texture.cpp
src/Renderer/Camera.cpp
src/Renderer/TextureAtlas.cpp
src/Renderer/SpriteBatch.cpp
src/Renderer/RenderTarget.cpp
src/Renderer/RenderTexture.cpp)
target_link_libraries(renderer resources)
add_library(engine STATIC
src/Engine/Engine.cpp
src/Engine/Transform.cpp
src/Engine/Sprite.cpp
src/Engine/SceneManager.cpp
src/Engine/Scene.cpp
src/Engine/GameObject.cpp
src/Engine/Component.cpp
src/Engine/DefaultScene.cpp
src/Engine/Layer.cpp
src/Engine/Text.cpp
src/Engine/AnimatedSprite.cpp
src/Engine/Rigidbody.cpp)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
find_package(PkgConfig REQUIRED)
# OpenAL
find_library(OPENAL_LOCATION openal)
target_link_libraries(audio ${OPENAL_LOCATION})
# GLEW
target_link_libraries(platform GL)
target_link_libraries(platform ${PROJECT_SOURCE_DIR}/ext/lib/glew/lib/linux/libGLEW.a)
# GLFW
pkg_search_module(GLFW REQUIRED glfw3)
target_link_libraries(platform ${GLFW_STATIC_LIBRARIES})
# PhysFs
find_library(PHYSFS_LOCATION physfs)
target_link_libraries(platform ${PHYSFS_LOCATION})
#FreeType
pkg_search_module(FREETYPE2 REQUIRED freetype2)
target_link_libraries(engine ${FREETYPE_STATIC_LIBRARIES})
target_link_libraries(engine ${CMAKE_SOURCE_DIR}/ext/lib/freetype-gl/lib/Linux/libfreetype-gl.a)
#Box2D
target_link_libraries(engine ${CMAKE_SOURCE_DIR}/ext/lib/Box2D/lib/Linux/libBox2D.a)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(engine platform core resources audio renderer)
add_executable(testproject
vs2013/TestProject/source/main.cpp
vs2013/TestProject/source/TestScene.cpp)
target_link_libraries(testproject engine)