forked from owodzeg/V4Hero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
152 lines (137 loc) · 5.37 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
cmake_minimum_required(VERSION 3.19)
project(V4Hero VERSION 1.2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD 20)
add_definitions(-DPATAFOUR_VERSION="${CMAKE_PROJECT_VERSION}")
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2.5.1 COMPONENTS graphics audio REQUIRED)
find_package(DiscordSDK 2.5.6 COMPONENTS x86_64 REQUIRED)
include(FetchContent)
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent
GIT_TAG v3.10.4)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_Declare(spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog
GIT_TAG v1.9.2)
FetchContent_MakeAvailable(spdlog)
set(ENGINE_FILES
Engine/Func.cpp
Engine/V4Core.cpp
Engine/Item/Item.cpp
Engine/Item/InventoryData.cpp
Engine/Item/Equipment.cpp
Engine/Item/ItemRegistry.cpp
Engine/Dialog/ControlTips.cpp
Engine/Dialog/RoundedRect.cpp
Engine/Dialog/MessageCloud.cpp
Engine/Dialog/DialogBox.cpp
Engine/Binary.cpp
Engine/Menu/MainMenu.cpp
Engine/Menu/ButtonList.cpp
Engine/Menu/Barracks.cpp
Engine/Menu/IntroductionMenu.cpp
Engine/Menu/Altar.cpp
Engine/Menu/Patapolis.cpp
Engine/Menu/MenuButton.cpp
Engine/Menu/Credits.cpp
Engine/Menu/Obelisk.cpp
Engine/Menu/OptionsMenu.cpp
Engine/Menu/MaterOuter.cpp
Engine/Menu/LoadingTip.cpp
Engine/Graphics/PSpritesheet.cpp
Engine/Graphics/Scene.cpp
Engine/Graphics/PSprite.cpp
Engine/Graphics/Menu.cpp
Engine/Graphics/PText.cpp
Engine/Graphics/ScreenFade.cpp
Engine/Math/PVector.cpp
Engine/SaveReader.cpp
Engine/Input/InputController.cpp
Engine/Rhythm/RhythmGUI.cpp
Engine/Rhythm/RhythmController.cpp
Engine/Rhythm/SongController.cpp
Engine/Rhythm/Drum.cpp
Engine/Rhythm/Rhythm.cpp
Engine/Rhythm/Song.cpp
Engine/Pon/Pon.cpp
Engine/Pon/PonRegistry.cpp
Engine/StringRepository.cpp
Engine/Config.cpp
Engine/TipsUtil.cpp
Engine/P4A.cpp
Engine/ResourceManager.cpp
Engine/TextureManager.cpp
Engine/CoreManager.cpp
Engine/StateManager.cpp
Engine/Mission/Background.cpp
Engine/Mission/Camera.cpp
Engine/Mission/MissionController.cpp
Engine/Mission/Weather.cpp
Engine/Mission/Units/CollidableObject.cpp
Engine/Mission/Units/AnimatedObject.cpp
Engine/Mission/Units/Hitbox.cpp
Engine/Mission/Units/Object.cpp
Engine/Mission/Units/Projectile.cpp
Engine/Mission/Units/Entity.cpp
Engine/Mission/Units/Entities/Kirajin/Kirajin_Yari_2.cpp
Engine/Mission/Units/Entities/Kirajin/Kirajin_Yari_1.cpp
Engine/Mission/Units/Entities/Animals/Rappata.cpp
Engine/Mission/Units/Entities/Animals/Kacheek.cpp
Engine/Mission/Units/Entities/Misc/DroppedItem.cpp
Engine/Mission/Units/Entities/Misc/EndFlag.cpp
Engine/Mission/Units/Entities/Misc/FeverWorm.cpp
Engine/Mission/Units/Entities/Obstacles/WoodenSpikes.cpp
Engine/Mission/Units/Entities/Obstacles/RockBig.cpp
Engine/Mission/Units/Entities/Obstacles/RockPile.cpp
Engine/Mission/Units/Entities/Obstacles/TreasureChest.cpp
Engine/Mission/Units/Entities/Obstacles/Wall.cpp
Engine/Mission/Units/Entities/Obstacles/RockSmall.cpp
Engine/Mission/Units/Entities/Buildings/KirajinPoweredTowerSmall.cpp
Engine/Mission/Units/Entities/Buildings/KirajinPoweredTowerBig.cpp
Engine/Mission/Units/Entities/Buildings/KirajinHut.cpp
Engine/Mission/Units/Entities/Buildings/KirajinGuardTower.cpp
Engine/Mission/Units/Entities/Nature/Grass2.cpp
Engine/Mission/Units/Entities/Nature/Grass1.cpp
Engine/Mission/Units/PlayableUnit.cpp
Engine/Mission/Units/HitboxFrame.cpp
Engine/Mission/Units/Units/Tatepon.cpp
Engine/Mission/Units/Units/Hatapon.cpp
Engine/Mission/Units/Units/Yaripon.cpp
Engine/Mission/Units/Projectiles/Spear.cpp
Engine/Mission/Mission.cpp
Engine/Utils.h)
add_executable(V4Hero ${ENGINE_FILES} main.cpp)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
message("Enabling Unity build for Release build")
set_target_properties(V4Hero PROPERTIES
UNITY_BUILD ON
UNITY_BUILD_BATCH_SIZE 5)
endif()
if(MSVC)
target_compile_options(V4Hero PRIVATE /W4)
target_compile_definitions(V4Hero PRIVATE _USE_MATH_DEFINES=1)
else()
target_compile_options(V4Hero PRIVATE -Wall -Wextra)
endif()
target_include_directories(V4Hero PRIVATE Engine/)
target_include_directories(V4Hero PRIVATE DiscordSDK)
target_link_libraries(V4Hero PRIVATE
sfml-graphics
sfml-audio
DiscordSDK
nlohmann_json::nlohmann_json
spdlog::spdlog)
if (OS STREQUAL "Linux")
find_package(X11 REQUIRED)
target_link_libraries(V4Hero PRIVATE X11::X11)
endif (OS STREQUAL "Linux")
add_custom_command(
TARGET V4Hero POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/resources ${PROJECT_BINARY_DIR}/resources
DEPENDS "${PROJECT_BINARY_DIR}/resources"
)