-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
111 lines (98 loc) · 3.66 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
cmake_minimum_required(VERSION 3.24)
project(SAOmega)
set(CMAKE_CXX_STANDARD 17)
set(PROJECT_NAME SAOmega)
################################################################################
# Source groups
################################################################################
set(Header_Files
"includes.h"
libs/mysql++11.h)
source_group("Header Files" FILES ${Header_Files})
set(Source_Files
)
source_group("Source Files" FILES ${Source_Files})
set(Source_Files__Helpers
"Helpers/macros.h"
"Helpers/singleton.h"
Helpers/BlueprintCache.h
Helpers/SafeQueue.hpp Helpers/TaskExecutor.cpp Helpers/TaskExecutor.h)
source_group("Source Files\\Helpers" FILES ${Source_Files__Helpers})
set(Source_Files__Plugin
"Plugin/saomega.h"
Plugin/spyglass.cpp Plugin/breeding.cpp Plugin/loot.cpp Plugin/experience.cpp Plugin/worldsave.cpp Plugin/saomega.cpp Plugin/config.cpp Plugin/util.cpp Plugin/commands.cpp Plugin/DB.h)
source_group("Source Files\\Plugin" FILES ${Source_Files__Plugin})
################################################################################
# Target
################################################################################
add_library(${PROJECT_NAME} SHARED ${Header_Files}
${Source_Files}
${Source_Files__Helpers}
${Source_Files__Plugin})
#use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
#set(ROOT_NAMESPACE SA)
set_target_properties(${PROJECT_NAME} PROPERTIES
VS_GLOBAL_KEYWORD "Win32Proj"
)
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION "TRUE"
)
################################################################################
# Include directories
################################################################################
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/ARK-Server-API/version/Core/Public;"
"${CMAKE_CURRENT_SOURCE_DIR}/.;"
"${CMAKE_CURRENT_SOURCE_DIR}/libs;"
"${CMAKE_CURRENT_SOURCE_DIR}/libs/mysql;"
"${CMAKE_CURRENT_SOURCE_DIR}/Plugin;"
"${CMAKE_CURRENT_SOURCE_DIR}/Helpers"
)
################################################################################
# Compile definitions
################################################################################
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"DEBUG_PLUGIN"
">"
"NDEBUG;"
"ARKSERVERAPITEMPLATE_EXPORTS;"
"_WINDOWS;"
"_USRDLL;"
"UNICODE;"
"_UNICODE"
)
################################################################################
# Compile and link options
################################################################################
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/Ot
>
/permissive-;
/Oi;
/sdl;
/Gy;
/W3;
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
${DEFAULT_CXX_EXCEPTION_HANDLING};
/Y-
)
target_link_options(${PROJECT_NAME} PRIVATE
/DEBUG;
/SUBSYSTEM:WINDOWS;
/OPT:REF;
/OPT:ICF;
/INCREMENTAL:NO
)
endif()
target_link_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/ARK-Server-API/out_lib"
"${CMAKE_CURRENT_SOURCE_DIR}/libs"
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND "postbuild.sh"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running Post Build"
)