-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
81 lines (72 loc) · 1.98 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
cmake_minimum_required(VERSION 3.5)
project(MediaPlayer)
set(CMAKE_C_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_PREFIX_PATH .)
file(GLOB_RECURSE SRC_FILES_DIR
${PROJECT_SOURCE_DIR}/include/libspng/*.c
${PROJECT_SOURCE_DIR}/include/xiziya_r/misc/*.c
${PROJECT_SOURCE_DIR}/src/*.c
${PROJECT_SOURCE_DIR}/src/mc/*.c
${PROJECT_SOURCE_DIR}/include/nbsparser/*.c
${PROJECT_SOURCE_DIR}/include/miniz/*.c
)
include_directories(
${CMAKE_SOURCE_DIR}/include/
${CMAKE_SOURCE_DIR}/include/libuv
${CMAKE_SOURCE_DIR}/include/ffmpeg-5.1.2
)
link_directories(
${CMAKE_SOURCE_DIR}/lib
)
add_definitions(
-DPLUGIN_VERSION_UNDEFINED
-DPLUGIN_ENVIRONMENT
-DSPNG_STATIC
)
add_library(MediaPlayer SHARED ${SRC_FILES_DIR})
set_target_properties(MediaPlayer PROPERTIES OUTPUT_NAME "MediaPlayer")
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions(
-D_GNU_SOURCE
)
find_package(ModLoader REQUIRED)
target_link_libraries(MediaPlayer
"${CMAKE_SOURCE_DIR}/lib/libserver_modloader.so"
"${CMAKE_SOURCE_DIR}/lib/libuv.so"
"${CMAKE_SOURCE_DIR}/lib/libcutils.a"
)
install(TARGETS MediaPlayer DESTINATION mods)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
project(convert)
add_executable(convert ${PROJECT_SOURCE_DIR}/tools/convert.c)
add_definitions(
-D"_CRT_SECURE_NO_WARNINGS"
-DWIN32_LEAN_AND_MEAN
)
add_compile_options(
/diagnostics:column
/FC
/GL
/nologo
/permissive-
/sdl
/utf-8
/Zi
)
add_link_options(
/LTCG
/INCREMENTAL:NO
)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD")
target_link_libraries(MediaPlayer
"${CMAKE_SOURCE_DIR}/lib/libuv.lib"
"${CMAKE_SOURCE_DIR}/lib/cutils.lib"
"ws2_32.lib"
"Iphlpapi.lib"
"dbghelp.lib"
"userenv.lib"
"lightbase.lib"
)
install(TARGETS MediaPlayer DESTINATION plugins)
endif()