代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.10)
project(MyProject)
# 设置编译选项
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 添加可执行文件 client
add_executable(client
client/src/Configuration.cpp
client/src/Connection.cpp
client/src/InetAddress.cpp
client/src/mainClient.cpp
client/src/Socket.cpp
client/src/SocketIO.cpp
client/src/TcpClient.cpp
client/src/TcpConnection.cpp
)
# 添加头文件搜索路径
target_include_directories(client PRIVATE
client/include
include
)
# 添加可执行文件 searchSever
add_executable(searchSever
src/tcpServer/Acceptor.cpp
src/tcpServer/Condition.cpp
src/tcpServer/EventLoop.cpp
src/tcpServer/InetAddress.cpp
src/tcpServer/mainSearchSever.cpp
src/tcpServer/Mutex.cpp
src/tcpServer/SearchServer.cpp
src/tcpServer/Socket.cpp
src/tcpServer/SocketIO.cpp
src/tcpServer/Task.cpp
src/tcpServer/TaskQueue.cpp
src/tcpServer/TcpConnection.cpp
src/tcpServer/TcpServer.cpp
src/tcpServer/Thread.cpp # 添加 Thread.cpp
src/tcpServer/ThreadPool.cpp # 添加 ThreadPool.cpp
src/dict/dictionary.cpp
src/dict/key_recommander.cpp
src/dict/split_tool.cpp
src/webPage/WebPageQuery.cpp
src/webPage/WebPageReader.cpp
src/Configuration.cpp
src/mylog.cpp
src/redis.cpp
src/LRUCache/CacheManager.cpp
src/LRUCache/CacheUpdateTask.cpp
src/LRUCache/LRUCache.cpp
src/LRUCache/TimerManager.cpp
)
# 添加头文件搜索路径
target_include_directories(searchSever PRIVATE
include
)
# 链接 pthread 库
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(searchSever PRIVATE Threads::Threads)
target_link_libraries(searchSever PRIVATE redis++)
# 链接log4cpp库
target_link_libraries(searchSever PRIVATE log4cpp)
# 添加可执行文件 buildDict
add_executable(buildDict
src/dict/mainDictCreate.cpp
src/dict/dict_producer.cpp
src/dict/split_tool.cpp
src/Configuration.cpp
src/mylog.cpp
)
# 添加头文件搜索路径
target_include_directories(buildDict PRIVATE
include
)
# 链接 pthread 库
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(buildDict PRIVATE Threads::Threads)
# 链接log4cpp库
target_link_libraries(buildDict PRIVATE log4cpp)
# 添加可执行文件 pageLibCreate
add_executable(pageLibCreate
src/pageLib/mainPageLib.cpp
src/pageLib/OffsetPage.cpp
src/pageLib/SimHash.cpp
src/pageLib/WebPages.cpp
src/Configuration.cpp
src/dict/split_tool.cpp
src/mylog.cpp
)
# 添加头文件搜索路径
target_include_directories(pageLibCreate PRIVATE
include
)
# 链接 pthread 库
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(pageLibCreate PRIVATE Threads::Threads)
# 链接log4cpp库
target_link_libraries(pageLibCreate PRIVATE log4cpp)
# 链接 tinyxml2 库
target_link_libraries(pageLibCreate PRIVATE tinyxml2)
# 指定安装规则
install(TARGETS client DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/client/bin)
install(TARGETS searchSever DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
install(TARGETS buildDict DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
install(TARGETS pageLibCreate DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。