-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (71 loc) · 1.91 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
cmake_minimum_required(VERSION 3.24)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
set(CMAKE_WINDOWS_SYMBOL_VISIBILITY_IN_STATIC_LIBRARIES OFF)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
project(m173 VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_INSTALL_MESSAGE LAZY)
set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/3rd/install/lib/cmake)
option(M173_COPY_SCRIPTS "This option enables copying of default Lua scripts to installation directory" ON)
option(M173_BETA18_PROTO "This option specifies used protocol version during compilation" OFF)
include_directories(BEFORE
${CMAKE_SOURCE_DIR}/3rd/install/include
${CMAKE_SOURCE_DIR}/server
)
link_directories(BEFORE
${CMAKE_SOURCE_DIR}/3rd/install/lib
)
find_package(spdlog "1.14.1" REQUIRED)
find_package(sockpp "1.0.0" REQUIRED)
if(M173_BETA18_PROTO)
set(M173_PROTO_VERSION "17")
else()
set(M173_PROTO_VERSION "14")
endif()
if(WIN32) # Windows...
set(platform_defines "-DNOMINMAX -DWIN32_LEAN_AND_MEAN")
endif()
add_definitions(${platform_defines} -DSPDLOG_USE_STD_FORMAT)
add_subdirectory(server)
add_executable(m173_server
$<TARGET_OBJECTS:entry>
$<TARGET_OBJECTS:runmanager>
$<TARGET_OBJECTS:entity>
$<TARGET_OBJECTS:commands>
$<TARGET_OBJECTS:blocks>
$<TARGET_OBJECTS:items>
$<TARGET_OBJECTS:recipes>
)
target_link_libraries(m173_server PRIVATE
# Third party and OS-depended
Sockpp::sockpp-static
spdlog::spdlog
# Own libraries
scriptvm
mcnetwork
platform
config
playerui
world
zlibpp
)
install(
TARGETS m173_server
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
if(WIN32)
install(
FILES $<TARGET_PDB_FILE:m173_server>
DESTINATION ${CMAKE_INSTALL_PREFIX} OPTIONAL
)
endif()
if(M173_COPY_SCRIPTS)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/scripts
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
endif()