-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (41 loc) · 1.35 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
cmake_minimum_required(VERSION 3.29)
project(RikkiPatcher)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out")
include(json)
include(webview)
include(sha)
include(7zip)
set(7ZIP_VER "2409")
download_7zip("${7ZIP_VER}")
set(7ZIP_DIR ${7zip_${7ZIP_VER}_DIR})
file(GLOB_RECURSE SRC_FILES
"${PROJECT_SOURCE_DIR}/src/**.hpp"
"${PROJECT_SOURCE_DIR}/src/**.cpp"
)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_executable(RikkiPatcher "${SRC_FILES}")
else()
add_executable(RikkiPatcher WIN32 "${SRC_FILES}")
endif()
target_precompile_headers(RikkiPatcher
PRIVATE "${PROJECT_SOURCE_DIR}/src/precompiled.hpp"
)
target_include_directories(RikkiPatcher
PRIVATE "${PROJECT_SOURCE_DIR}/src"
PRIVATE "${json_SOURCE_DIR}/single_include"
)
target_link_libraries(RikkiPatcher
PRIVATE webview::core
PRIVATE SHA::static
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
add_definitions("-DUNICODE" "-D_UNICODE")
add_custom_command(TARGET RikkiPatcher POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/res/ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMAND ${CMAKE_COMMAND} -E copy_directory
${7ZIP_DIR}/ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/7zip
)