-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
121 lines (103 loc) · 2.86 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
113
114
115
116
117
118
119
120
121
cmake_minimum_required (VERSION 3.7)
project (Project)
message("Using CMake version ${CMAKE_VERSION}")
message("Processing CMakeLists.txt")
# Where should the project build to
set (CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/Build)
# Compiler version
set (CMAKE_CXX_STANDARD 17)
# If on Windows, specify where these packages are installed
if (WIN32)
set(SFML_STATIC_LIBRARIES TRUE)
set(SFML_DIR "C:/Program Files (x86)/SFML-2.5.1/lib/cmake/SFML")
endif()
# Find X11
find_package(X11)
# Find multithreading package
find_package(Threads REQUIRED)
# Find OpenGL
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED)
# Find SFML
find_package(SFML 2.5.1 REQUIRED COMPONENTS window system graphics audio)
# Create the executable
set(EXECUTABLE_NAME ${PROJECT_NAME})
add_executable (${EXECUTABLE_NAME} src/main.cpp)
# Add sources
target_sources(${EXECUTABLE_NAME} PRIVATE
# Core
src/App.h
src/App.cpp
src/Resources.h
src/Resources.cpp
src/Scene.h
src/Scene.cpp
# Controllers
src/Controller/Common.h
src/Controller/Random/Random.h
src/Controller/AStar/AStar.h
# Scenes
src/Scenes/Welcome/Welcome.h
src/Scenes/TicTacToe/TicTacToe.h
src/Scenes/TicTacToe/TicTacToe.cpp
src/Scenes/TicTacToe/Common.h
src/Scenes/TicTacToe/GameState.h
src/Scenes/TicTacToe/Cost.h
src/Scenes/Strategy/Strategy.h
src/Scenes/Strategy/Strategy.cpp
src/Scenes/Strategy/Common.h
src/Scenes/Strategy/GameState.h
src/Scenes/Strategy/Map.h
src/Scenes/Strategy/Map.cpp
src/Scenes/Strategy/Objects.h
src/Scenes/Strategy/Action.h
# Case studies
src/Scenes/Strategy/AI/BaseCase.h
src/Scenes/Strategy/AI/CaseOne/CaseOne.h
src/Scenes/Strategy/AI/CaseOne/CaseOne.cpp
src/Scenes/Strategy/AI/CaseTwo/CaseTwo.h
src/Scenes/Strategy/AI/CaseTwo/CaseTwo.cpp
src/Scenes/Strategy/AI/CaseThree/CaseThree.h
src/Scenes/Strategy/AI/CaseThree/CaseThree.cpp
src/Scenes/Strategy/AI/CaseFour/CaseFour.h
src/Scenes/Strategy/AI/CaseFour/CaseFour.cpp
# Development
src/Console.h
src/Console.cpp
src/imgui/imconfig.h
src/imgui/imgui.h
src/imgui/imgui.cpp
src/imgui/imgui-SFML.h
src/imgui/imgui-SFML.cpp
src/imgui/imgui_demo.cpp
src/imgui/imgui_draw.cpp
src/imgui/imgui_internal.h
src/imgui/imgui_widgets.cpp
src/imgui/imstb_rectpack.h
src/imgui/imstb_truetype.h
)
# Platform specific building
if (WIN32)
# Link libraries so that they can be used in the project
target_link_libraries(${EXECUTABLE_NAME}
sfml-window
sfml-system
sfml-graphics
sfml-audio
${CMAKE_THREAD_LIBS_INIT}
)
endif()
if(UNIX)
# Link libraries so that they can be used in the project
target_link_libraries(${EXECUTABLE_NAME} stdc++fs
GL
sfml-window
sfml-system
sfml-graphics
sfml-audio
${X11_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
endif()
# Copy config files and assets
file(COPY ${CMAKE_SOURCE_DIR}/Assets DESTINATION ${CMAKE_BINARY_DIR})