5 Star 0 Fork 0

周鑫文/search_engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 3.25 KB
一键复制 编辑 原始数据 按行查看 历史
zky9121 提交于 2023-07-11 16:14 . LRU接入关键词
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)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wahahabulala/search_engine.git
git@gitee.com:wahahabulala/search_engine.git
wahahabulala
search_engine
search_engine
master

搜索帮助