-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
83 lines (66 loc) · 2.75 KB
/
Copy pathCMakeLists.txt
File metadata and controls
83 lines (66 loc) · 2.75 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
# =============================================================================
# NetworkModule Root CMakeLists.txt
# =============================================================================
# Root build configuration for the NetworkModule project
cmake_minimum_required(VERSION 3.15)
project(
NetworkModule
VERSION 1.0.0
LANGUAGES CXX
)
# =============================================================================
# Project-wide Configuration
# =============================================================================
# C++ Standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Build output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# =============================================================================
# Subdirectories
# TestClient - Cross-platform TCP test client
add_subdirectory(Client/TestClient)
# =============================================================================
# Server Targets (Cross-platform)
# =============================================================================
option(BUILD_SERVER_ENGINE "Build ServerEngine library" ON)
option(BUILD_TEST_SERVER "Build TestServer" ON)
option(BUILD_DB_SERVER "Build DBServer" ON)
option(BUILD_TESTS "Build AsyncIO unit test executables (EpollTest, IOUringTest)" OFF)
option(ENABLE_DATABASE_SUPPORT "Enable database support" OFF)
if (BUILD_TEST_SERVER AND NOT BUILD_SERVER_ENGINE)
message(FATAL_ERROR "TestServer requires BUILD_SERVER_ENGINE=ON")
endif()
if (BUILD_DB_SERVER AND NOT BUILD_SERVER_ENGINE)
message(FATAL_ERROR "DBServer requires BUILD_SERVER_ENGINE=ON")
endif()
if (BUILD_SERVER_ENGINE)
add_subdirectory(Server/ServerEngine)
endif()
if (BUILD_TEST_SERVER)
add_subdirectory(Server/TestServer)
endif()
if (BUILD_DB_SERVER)
add_subdirectory(Server/DBServer)
endif()
if (BUILD_TESTS)
if (NOT BUILD_SERVER_ENGINE)
message(FATAL_ERROR "BUILD_TESTS requires BUILD_SERVER_ENGINE=ON")
endif()
add_subdirectory(Server/Tests)
endif()
# =============================================================================
# Summary
# =============================================================================
message(STATUS "")
message(STATUS "========== NetworkModule Configuration ==========")
message(STATUS "Project: ${PROJECT_NAME}")
message(STATUS "Version: ${PROJECT_VERSION}")
message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}")
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Binary Directory: ${CMAKE_BINARY_DIR}")
message(STATUS "Source Directory: ${CMAKE_SOURCE_DIR}")
message(STATUS "================================================")
message(STATUS "")