-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
72 lines (58 loc) · 1.95 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
cmake_minimum_required(VERSION 3.5)
project(cs16-client)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
set(EXTRAS_DIR "${CMAKE_CURRENT_BINARY_DIR}/extras")
include(LibraryNaming)
# include(ExternalProject)
option(BUILD_CLIENT "Build client library." ON)
option(BUILD_MAINUI "Build menu library." ON)
option(BUILD_SERVER "Build server library." ON)
set(GAME_DIR "cstrike" CACHE STRING "Game directory name.")
set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Client library location.")
set(SERVER_INSTALL_DIR "dlls" CACHE STRING "Server library location.")
# if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug")
# add_compile_options(/fsanitize=address)
# add_link_options(/fsanitize=address)
# endif()
if(VITA)
message(STATUS "Building for PS Vita")
add_compile_options(-fno-use-cxa-atexit)
endif()
if(BUILD_CLIENT)
add_subdirectory(cl_dll)
endif()
# if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# set(MESON_BUILD_TYPE debug)
# elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
# set(MESON_BUILD_TYPE debugoptimized)
# else()
# set(MESON_BUILD_TYPE release)
# endif()
if(BUILD_SERVER)
# ExternalProject_Add(
# yapb
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/yapb
# CONFIGURE_COMMAND meson setup --buildtype ${MESON_BUILD_TYPE} build
# BUILD_COMMAND meson compile -C build
# BUILD_ALWAYS 1
# BUILD_IN_SOURCE 1
# INSTALL_COMMAND meson install -C build --destdir ${CMAKE_INSTALL_PREFIX}
# )
add_subdirectory(3rdparty/yapb)
add_subdirectory(3rdparty/ReGameDLL_CS)
endif()
if(BUILD_MAINUI)
# set(CS16CLIENT ON)
# set(XASH_SDK ../../)
add_subdirectory(3rdparty/mainui_cpp)
endif()
include(GenerateExtras)
if(WIN32)
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_FILE_NAME "CS16Client-${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
else()
set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_FILE_NAME "CS16Client-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
endif()
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
include(CPack)