forked from mark-mon/Dumper7UEVR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (75 loc) · 2.83 KB
/
Copy pathCMakeLists.txt
File metadata and controls
90 lines (75 loc) · 2.83 KB
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
cmake_minimum_required(VERSION 3.15...4.0)
# Ninja generator does not support platform specification
if(CMAKE_GENERATOR MATCHES "Ninja")
# Remove all variables related to platform
unset(CMAKE_GENERATOR_PLATFORM CACHE)
unset(CMAKE_GENERATOR_PLATFORM)
unset(CMAKE_VS_PLATFORM_NAME CACHE)
unset(CMAKE_VS_PLATFORM_NAME)
message(STATUS "Using Ninja generator - platform specification disabled")
endif()
project(Dumper-7 LANGUAGES CXX C)
include(${CMAKE_SOURCE_DIR}/cmake/common.cmake)
# Source files - automatic search for all source files
file(GLOB_RECURSE CPP_SOURCES
"Dumper/*.cpp"
"Dumper/*.cxx"
"Dumper/*.cc"
"Dumper/*.c"
)
add_library(${PROJECT_NAME} SHARED ${CPP_SOURCES})
# Include directories
target_include_directories(${PROJECT_NAME} PRIVATE
# Dumper
${CMAKE_SOURCE_DIR}/Dumper
# Engine
${CMAKE_SOURCE_DIR}/Dumper/Engine
${CMAKE_SOURCE_DIR}/Dumper/Engine/Private
${CMAKE_SOURCE_DIR}/Dumper/Engine/Private/OffsetFinder
${CMAKE_SOURCE_DIR}/Dumper/Engine/Private/Unreal
# Engine Public
${CMAKE_SOURCE_DIR}/Dumper/Engine/Public
${CMAKE_SOURCE_DIR}/Dumper/Engine/Public/OffsetFinder
${CMAKE_SOURCE_DIR}/Dumper/Engine/Public/Unreal
# Platform headers are included as "Platform.h" throughout the dumper.
${CMAKE_SOURCE_DIR}/Dumper/Platform
${CMAKE_SOURCE_DIR}/Dumper/Platform/Private
${CMAKE_SOURCE_DIR}/Dumper/Platform/Public
# Generator
${CMAKE_SOURCE_DIR}/Dumper/Generator
${CMAKE_SOURCE_DIR}/Dumper/Generator/Private
${CMAKE_SOURCE_DIR}/Dumper/Generator/Private/Generators
${CMAKE_SOURCE_DIR}/Dumper/Generator/Private/Managers
${CMAKE_SOURCE_DIR}/Dumper/Generator/Private/Wrappers
# Generator Public
${CMAKE_SOURCE_DIR}/Dumper/Generator/Public
${CMAKE_SOURCE_DIR}/Dumper/Generator/Public/Generators
${CMAKE_SOURCE_DIR}/Dumper/Generator/Public/Managers
${CMAKE_SOURCE_DIR}/Dumper/Generator/Public/Wrappers
# Utils
${CMAKE_SOURCE_DIR}/Dumper/Utils
${CMAKE_SOURCE_DIR}/Dumper/Utils/Compression
${CMAKE_SOURCE_DIR}/Dumper/Utils/Dumpspace
${CMAKE_SOURCE_DIR}/Dumper/Utils/Encoding
${CMAKE_SOURCE_DIR}/Dumper/Utils/Json
)
# Compiler definitions
target_compile_definitions(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
_CONSOLE
WIN32
)
# Set Windows subsystem
set_target_properties(${PROJECT_NAME} PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
VS_GLOBAL_KEYWORD "Win32Proj"
)
if(MSVC)
# Keep a matching release PDB with the plugin so in-game dump failures remain actionable.
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Release>:/Zi>)
target_link_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Release>:/DEBUG>)
set_target_properties(${PROJECT_NAME} PROPERTIES
PDB_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin/Release"
)
endif()