-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
108 lines (91 loc) · 3.55 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
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lwsock32 -lws2_32 ${CMAKE_CXX_STANDARD_LIBRARIES}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
set(PROJECT_NAME "platformer-2d")
project(${PROJECT_NAME})
set(EXTERNAL_LIBRARIES_DIR "lib/")
set(SHARED_LIBRARIES_DIR "${EXTERNAL_LIBRARIES_DIR}/shared_lib")
set(SFML_DIR "${CMAKE_CURRENT_LIST_DIR}/${EXTERNAL_LIBRARIES_DIR}/SFML-2.5.1/lib/cmake/SFML")
set(TGUI_DIR "${CMAKE_CURRENT_LIST_DIR}/${EXTERNAL_LIBRARIES_DIR}/TGUI-0.8/lib/cmake/TGUI")
include_directories(include
include/Core
include/States
include/States/Core
include/GUI
include/GUI/Core
include/GUI/Views/
include/GUI/Configs/
include/ResourceManager
include/Encoder
include/Encoder/Utility
include/Events
include/Entities
include/Entities/Player
include/Entities/Overlay
include/GUI/HUD
googletest/googletest/include
googletest/googlemock/include)
set(SOURCE_FILES
src/Core/main.cpp
src/Core/Game.cpp
src/Core/Window.cpp
src/States/Core/StateMachine.cpp
src/States/StateGame.cpp
src/States/StateMenu.cpp
src/States/Core/StateID.cpp
src/ResourceManager/ResourceHolder.cpp
src/ResourceManager/ResourceManager.cpp
src/GUI/Configs/MenuConfig.cpp
src/GUI/Views/MenuView.cpp
src/States/StateMapLoader.cpp
src/GUI/Views/MapLoaderView.cpp
src/GUI/Configs/MapLoaderConfig.cpp
src/Encoder/FileReader.cpp
src/Encoder/BmpReader.cpp
src/Encoder/TxtReader.cpp
src/Encoder/Encoder.cpp
src/Encoder/MapLoader.cpp
src/Encoder/Utility/MapNameValidator.cpp
src/Core/Configuration.cpp src/Entities/Entity.cpp
src/Entities/Block.cpp
src/Entities/Player/Player.cpp
src/Core/Camera.cpp
src/Events/CollisionEvent.cpp
src/Events/MovementEvent.cpp
src/Entities/Objective.cpp
src/Events/InputEvent.cpp
src/Core/Settings.cpp
src/States/StateOptions.cpp
src/GUI/Views/OptionsView.cpp
src/Entities/Overlay/LivesOverlay.cpp
src/Entities/Life.cpp
src/Entities/Overlay/LivesBorder.cpp
src/Entities/Spike.cpp
src/Entities/HeartCollectible.cpp
src/States/StatePaused.cpp
src/GUI/Views/PausedView.cpp
src/GUI/Configs/PausedConfig.cpp
src/Core/ActionMap.cpp
src/GUI/Configs/OptionsConfig.cpp
src/States/StateKeybinds.cpp
src/States/StateRestart.cpp
src/GUI/Views/RestartView.cpp
src/GUI/Configs/RestartConfig.cpp
src/Entities/Overlay/FpsOverlay.cpp
src/States/StateAbout.cpp
src/GUI/Views/KeybindsView.cpp
src/GUI/Configs/KeybindsConfig.cpp)
find_package(SFML 2.5.1 COMPONENTS graphics network audio REQUIRED)
find_package(TGUI 0.8 REQUIRED)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
set(SFML_LIBRARIES sfml-graphics sfml-audio)
set(TGUI_LIBRARIES tgui)
set(PROJECT_LIBRARIES ${SFML_LIBRARIES} ${TGUI_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBRARIES})
# copy the sfml libraries into the build directory
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_LIST_DIR}/${SHARED_LIBRARIES_DIR}/"
$<TARGET_FILE_DIR:${PROJECT_NAME}>)
add_subdirectory(test)