-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (66 loc) · 1.84 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
cmake_minimum_required(VERSION 3.10) # CMake version check
project(TheGame)
include(FetchContent)
set(FETCHCONTENT_QUIET FALSE)
set(CMAKE_CXX_STANDARD 14)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
set(SFML_VERSION 2.5.1)
FetchContent_Declare(
SFML
GIT_REPOSITORY "https://github.com/SFML/SFML.git"
GIT_TAG "${SFML_VERSION}"
)
FetchContent_GetProperties(sfml)
if(NOT sfml_POPULATED)
FetchContent_Populate(sfml)
add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR})
endif()
set(SRC
src/main.cpp
src/utils/transform.cpp
src/entities/Entity.cpp
src/entities/Player.cpp
src/entities/Enemy.cpp
src/entities/TileSprite.cpp
src/entities/Text.cpp
src/renderer/Renderer.cpp
src/renderer/Sfml.cpp
src/manager/EntityManager.cpp
src/manager/SceneManager.cpp
src/manager/Core.cpp
src/scenes/Scene.cpp
src/scenes/DariusLight.cpp
src/scenes/DariusDark.cpp
src/scenes/Menu.cpp
src/scenes/GameOver.cpp
src/map/Map.cpp
src/music/MyMusic.cpp
src/manager/MusicManager.cpp
src/sound/MySound.cpp
src/manager/SoundManager.cpp
src/entities/P_button.cpp
src/entities/DariusButton.cpp
)
add_executable(${PROJECT_NAME} ${SRC})
target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-audio)
target_include_directories(${PROJECT_NAME} PRIVATE
src/entities/
src/utils/
src/interfaces/
src/renderer/
src/common/
src/manager/
src/scenes/
src/map/
src/sound/
src/music/
)
# Set Debug flags for your project
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:-g3>)
# Set Release flags specifically for SFML library
set_target_properties(sfml-graphics PROPERTIES
CMAKE_BUILD_TYPE Release
)
set_target_properties(sfml-audio PROPERTIES
CMAKE_BUILD_TYPE Release
)