当前位置:网站首页>Cluster chat server: creation of project directory
Cluster chat server: creation of project directory
2022-07-23 21:18:00 【_ Soren】
Project directory
stay CMake The article said , A project roughly includes the following modules :
stay include Header file , There is a directory dedicated to storing server header files server, And a public document public.hpp

And in the server, It is also divided into database layer ,model layer , The network layer , The business layer , And with the help of redis.
In the source file src in , Including servers server And the client client, Each file has a corresponding CMakeLists.txt file :

Source file src Of CMakeLists.txt
add_subdirectory(server)
add_subdirectory(client)
client Of CMakeLists.txt
# Defined a SRC_LIST Variable , Contains all the source files in this directory
aux_source_directory(. SRC_LIST)
# Specify to generate executable file
add_executable(ChatClient ${
SRC_LIST})
# Specify the library files that you need to rely on when linking executable files
target_link_libraries(ChatClient pthread)
server Of CMakeLists.txt file
# Defined a SRC_LIST Variable , Contains all the source files in this directory
aux_source_directory(. SRC_LIST)
aux_source_directory(./db DB_LIST)
aux_source_directory(./model MODEL_LIST)
aux_source_directory(./redis REDIS_LIST)
# Specify to generate executable file
add_executable(ChatServer ${
SRC_LIST} ${
DB_LIST} ${
MODEL_LIST} ${
REDIS_LIST})
# Specify the library files that you need to rely on when linking executable files
target_link_libraries(ChatServer muduo_net muduo_base mysqlclient hiredis pthread)
Of the whole project CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(ChatServer)
# Configure compile options
set(CMAKE_CXX_FLAGS ${
CMAKE_CXX_FLAGS} -g)
# Configure the path of the final executable output
set(EXECUTABLE_OUTPUT_PATH ${
PROJECT_SOURCE_DIR}/bin)
# Configure header file search path
include_directories(${
PROJECT_SOURCE_DIR}/include)
include_directories(${
PROJECT_SOURCE_DIR}/include/server)
include_directories(${
PROJECT_SOURCE_DIR}/include/server/db)
include_directories(${
PROJECT_SOURCE_DIR}/include/server/model)
include_directories(${
PROJECT_SOURCE_DIR}/include/server/redis)
include_directories(${
PROJECT_SOURCE_DIR}/thirdparty)
# load subdirectory
add_subdirectory(src)
边栏推荐
- Green-Tao 定理的证明 (2): Von Neumann 定理的推广
- 高数下|二重积分的计算4|高数叔|手写笔记
- 一时跳槽一时爽,一直跳槽一直爽?
- scala编程(初级)
- OpenCV图像处理——拉普拉斯金字塔
- Unity solves that animation is not available: the animationclip 'xxx' used by the animation component 'xxx' must be marked as legacy
- Is it safe to open a mobile stock account?
- 集群聊天服务器:网络模块ChatServer
- (Note)优化器Adam的学习率设置
- googletest
猜你喜欢

高数下|三重积分的计算1|高数叔|手写笔记

Chapter 2 回归

MySQL数据库索引

Modular development

At 12 o'clock on July 23, 2022, the deviation from the top of the line of love life hour appeared, maintaining a downward trend and waiting for the rebound signal.

LU_ASR01语音模块使用

WinDbg practice -- Introduction

Chapter1 data cleaning
![[attack and defense world web] difficulty four-star 12 point advanced question: flatscience](/img/fc/6648116f1bb47f1888035796fa5a58.png)
[attack and defense world web] difficulty four-star 12 point advanced question: flatscience

高数下|二重积分的计算2|高数叔|手写笔记
随机推荐
1062 Talent and Virtue
flink原理及开发总结(详细)
Minimum spanning tree: Kruskal
Connect with Hunan Ca and use U_ Key login
Synchronized同步锁的基本原理
剑指Offer第二版:字符串(简单)
高数下|二重积分的计算2|高数叔|手写笔记
Green Tao theorem (4): energy increment method
剑指 Offer II 115. 重建序列 : 拓扑排序构造题
【arxiv】第一次上传论文小记
手机测试相关基础知识
【微信小程序】你了解小程序开发吗?
LeetCode热题 HOT52-100
合宙ESP32C3硬件配置信息串口打印輸出
手机股票开户安全吗?
Modular development
[leetcode] day101 rotating image
Protocol buffers 的问题和滥用
Green-Tao 定理 (3): 反一致函数及其生成的 Sigma-代数
HDU - 2586 How far away ?(倍增LCA)