forked from cursey/regenny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
235 lines (186 loc) · 5.21 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# This file is automatically generated from cmake.toml - DO NOT EDIT
# See https://github.com/build-cpp/cmkr for more information
cmake_minimum_required(VERSION 3.15)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
endif()
# Regenerate CMakeLists.txt automatically in the root project
set(CMKR_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMKR_ROOT_PROJECT ON)
# Bootstrap cmkr
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
if(CMKR_INCLUDE_RESULT)
cmkr()
endif()
# Enable folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
# Create a configure-time dependency on cmake.toml to improve IDE support
if(CMKR_ROOT_PROJECT)
configure_file(cmake.toml cmake.toml COPYONLY)
endif()
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
project(regenny)
if(CMKR_ROOT_PROJECT AND NOT CMKR_DISABLE_VCPKG)
include(FetchContent)
message(STATUS "Fetching vcpkg (2023.12.12)...")
FetchContent_Declare(vcpkg URL "https://github.com/microsoft/vcpkg/archive/refs/tags/2023.12.12.tar.gz")
FetchContent_GetProperties(vcpkg)
if(NOT vcpkg_POPULATED)
FetchContent_Populate(vcpkg)
include("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake")
endif()
endif()
include(FetchContent)
message(STATUS "Fetching sdkgenny (cbf986af49c45afb2016c96202b66d66fa1cbd8e)...")
FetchContent_Declare(sdkgenny
GIT_REPOSITORY
"https://github.com/cursey/sdkgenny.git"
GIT_TAG
cbf986af49c45afb2016c96202b66d66fa1cbd8e
)
FetchContent_MakeAvailable(sdkgenny)
message(STATUS "Fetching luagenny (556c914a846ccf3f358b559e99d4610f71d71c29)...")
FetchContent_Declare(luagenny
GIT_REPOSITORY
"https://github.com/praydog/luagenny.git"
GIT_TAG
556c914a846ccf3f358b559e99d4610f71d71c29
)
FetchContent_MakeAvailable(luagenny)
# Packages
find_package(imgui REQUIRED)
find_package(fmt REQUIRED)
find_package(pegtl REQUIRED)
find_package(unofficial-nativefiledialog REQUIRED)
find_package(spdlog REQUIRED)
find_package(utf8cpp REQUIRED)
find_package(SDL2 REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(glad REQUIRED)
find_package(sol2 REQUIRED)
find_package(lua REQUIRED)
# Target regenny
set(CMKR_TARGET regenny)
set(regenny_SOURCES "")
list(APPEND regenny_SOURCES
"src/AboutUi.cpp"
"src/Config.cpp"
"src/LoggerUi.cpp"
"src/Main.cpp"
"src/MemoryUi.cpp"
"src/Process.cpp"
"src/Project.cpp"
"src/ReGenny.cpp"
"src/Utility.cpp"
"src/arch/Arch.cpp"
"src/arch/Windows.cpp"
"src/node/Array.cpp"
"src/node/Base.cpp"
"src/node/Bitfield.cpp"
"src/node/Pointer.cpp"
"src/node/Struct.cpp"
"src/node/Undefined.cpp"
"src/node/UndefinedBitfield.cpp"
"src/node/Variable.cpp"
"src/AboutUi.hpp"
"src/Config.hpp"
"src/Helpers.hpp"
"src/LoggerUi.hpp"
"src/MemoryUi.hpp"
"src/Process.hpp"
"src/Project.hpp"
"src/ReGenny.hpp"
"src/Utility.hpp"
"src/arch/Arch.hpp"
"src/arch/Windows.hpp"
"src/node/Array.hpp"
"src/node/Base.hpp"
"src/node/Bitfield.hpp"
"src/node/Pointer.hpp"
"src/node/Property.hpp"
"src/node/Struct.hpp"
"src/node/Undefined.hpp"
"src/node/UndefinedBitfield.hpp"
"src/node/Variable.hpp"
"thirdparty/SDL_Trigger/sdl_trigger.cpp"
"thirdparty/scope_gaurd/scope_guard.hpp"
"thirdparty/SDL_Trigger/sdl_trigger.h"
)
if(WIN32) # windows
list(APPEND regenny_SOURCES
"src/arch/Windows.rc"
)
endif()
list(APPEND regenny_SOURCES
cmake.toml
)
set(CMKR_SOURCES ${regenny_SOURCES})
add_executable(regenny)
if(regenny_SOURCES)
target_sources(regenny PRIVATE ${regenny_SOURCES})
endif()
get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT)
if(NOT CMKR_VS_STARTUP_PROJECT)
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT regenny)
endif()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${regenny_SOURCES})
target_compile_definitions(regenny PRIVATE
UTF_CPP_CPLUSPLUS=201103L
)
target_compile_features(regenny PRIVATE
cxx_std_17
)
target_compile_options(regenny PRIVATE
"/EHa"
)
target_include_directories(regenny PRIVATE
"src/"
"thirdparty/scope_gaurd/"
"thirdparty/SDL_Trigger/"
)
target_link_libraries(regenny PRIVATE
imgui::imgui
fmt::fmt
taocpp::pegtl
unofficial::nativefiledialog::nfd
spdlog::spdlog
SDL2::SDL2
SDL2::SDL2main
nlohmann_json::nlohmann_json
glad::glad
sdkgenny::sdkgenny
lua
sol2
luagenny::luagenny
)
add_custom_command(
TARGET regenny POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:luagenny_shared> $<TARGET_FILE_DIR:regenny>)
unset(CMKR_TARGET)
unset(CMKR_SOURCES)
# Target test0
set(CMKR_TARGET test0)
set(test0_SOURCES "")
list(APPEND test0_SOURCES
"examples/test0.cpp"
)
list(APPEND test0_SOURCES
cmake.toml
)
set(CMKR_SOURCES ${test0_SOURCES})
add_executable(test0)
if(test0_SOURCES)
target_sources(test0 PRIVATE ${test0_SOURCES})
endif()
get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT)
if(NOT CMKR_VS_STARTUP_PROJECT)
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT test0)
endif()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${test0_SOURCES})
target_compile_features(test0 PRIVATE
cxx_std_17
)
unset(CMKR_TARGET)
unset(CMKR_SOURCES)