54 lines
1.3 KiB
CMake
54 lines
1.3 KiB
CMake
|
|
cmake_minimum_required(VERSION 3.16)
|
||
|
|
project(ScarChat CXX)
|
||
|
|
|
||
|
|
set(CMAKE_CXX_STANDARD 17)
|
||
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||
|
|
set(CMAKE_AUTOMOC ON)
|
||
|
|
set(CMAKE_AUTORCC ON)
|
||
|
|
set(CMAKE_AUTOUIC ON)
|
||
|
|
|
||
|
|
# Find required packages
|
||
|
|
find_package(OpenSSL REQUIRED)
|
||
|
|
|
||
|
|
# Server binary (Linux/cross-platform)
|
||
|
|
add_executable(chat_server
|
||
|
|
src/server/server.cpp
|
||
|
|
)
|
||
|
|
target_link_libraries(chat_server PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||
|
|
target_compile_options(chat_server PRIVATE -Wall -Wextra -std=c++17)
|
||
|
|
|
||
|
|
# Qt Client binary (Linux/cross-platform)
|
||
|
|
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
|
||
|
|
|
||
|
|
add_executable(chat_client_qt
|
||
|
|
src/qt_client/main.cpp
|
||
|
|
)
|
||
|
|
target_link_libraries(chat_client_qt PRIVATE
|
||
|
|
Qt5::Core
|
||
|
|
Qt5::Gui
|
||
|
|
Qt5::Widgets
|
||
|
|
Qt5::Network
|
||
|
|
OpenSSL::SSL
|
||
|
|
OpenSSL::Crypto
|
||
|
|
)
|
||
|
|
target_compile_options(chat_client_qt PRIVATE -Wall -Wextra -std=c++17)
|
||
|
|
|
||
|
|
# Windows Client binary (Windows-only)
|
||
|
|
if(WIN32)
|
||
|
|
add_executable(chat_client_win WIN32
|
||
|
|
src/windows_client/main_win.cpp
|
||
|
|
)
|
||
|
|
target_link_libraries(chat_client_win PRIVATE
|
||
|
|
ws2_32
|
||
|
|
crypt32
|
||
|
|
)
|
||
|
|
target_compile_options(chat_client_win PRIVATE /W4)
|
||
|
|
endif()
|
||
|
|
|
||
|
|
# Installation targets
|
||
|
|
install(TARGETS chat_server DESTINATION bin)
|
||
|
|
install(TARGETS chat_client_qt DESTINATION bin)
|
||
|
|
if(WIN32)
|
||
|
|
install(TARGETS chat_client_win DESTINATION bin)
|
||
|
|
endif()
|