mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-13 16:41:48 +08:00
add http and websocket
This commit is contained in:
@ -9,20 +9,27 @@ set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# set(CMAKE_PREFIX_PATH C:/src/vcpkg/installed/x64-windows)
|
||||
|
||||
# 查找Qt版本
|
||||
find_package(Qt6 COMPONENTS Protobuf Widgets QUIET)
|
||||
# 查找模块
|
||||
find_package(Qt6 COMPONENTS
|
||||
Protobuf
|
||||
Widgets
|
||||
Network
|
||||
WebSockets
|
||||
QUIET)
|
||||
|
||||
set(QT_VERSION_MAJOR 6)
|
||||
|
||||
|
||||
|
||||
# proto文件
|
||||
file(GLOB PB_FILES
|
||||
proto/*.proto
|
||||
)
|
||||
file(GLOB_RECURSE PROJECT_SOURCES
|
||||
*.cpp
|
||||
*.h
|
||||
|
||||
# 源文件
|
||||
file(GLOB PROJECT_SOURCES
|
||||
model/*.h model/*.cpp
|
||||
network/*.h network/*.cpp
|
||||
*.h *.cpp
|
||||
*.ui
|
||||
*.qrc
|
||||
)
|
||||
@ -48,14 +55,9 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(ClientChat PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
|
||||
if(${QT_VERSION_MAJOR} EQUAL 6)
|
||||
qt_finalize_executable(ClientChat)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS ClientChat
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
# 链接动态库
|
||||
target_link_libraries(ClientChat PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt6::Network
|
||||
Qt6::WebSockets
|
||||
)
|
||||
Reference in New Issue
Block a user