Files
Commonwealth-Online-Public/host-gui/CMakeLists.txt
T
andrewandCursor 98266ec235 Add native C++ Qt6 GUI host application
Introduce production-grade desktop GUI for hosting Commonwealth Online servers.

Features:
- Native C++ Qt6 application with minimal dependencies
- Start/stop server buttons with live status indicator
- Real-time stats display (uptime, clients, packet counts)
- Live connected clients table
- Server log viewer with timestamps
- Fallout 4-inspired dark theme (amber/green accents)
- Subprocess management (server independent of GUI)
- Auto-detection of Python and server directory
- Professional error handling and graceful shutdown

Architecture:
- MainWindow: Qt UI components and layout
- ServerProcess: Manages Python relay subprocess
- Subprocess spawns consumer_server_cli.py
- Real-time log capture and parsing
- Qt signals/slots for UI updates

Build:
- CMake 3.20+ configuration
- Visual Studio 2022 MSVC compiler
- Qt6.4+ required
- Windows 10+ target
- build.bat script for easy compilation

Project structure:
- src/main.cpp - entry point
- src/MainWindow.h/cpp - main UI window
- src/ServerProcess.h/cpp - subprocess and IPC layer
- src/resources/ - Qt resources and icons
- CMakeLists.txt - Qt6 build config
- build.bat - Windows build script
- README.md - user guide
- DEVELOPMENT.md - developer guide

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 20:53:16 +12:00

54 lines
1.0 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(CommonwealthOnlineHost)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 COMPONENTS
Core
Gui
Widgets
Network
Concurrent
REQUIRED
)
set(PROJECT_SOURCES
src/main.cpp
src/MainWindow.h
src/MainWindow.cpp
src/ServerProcess.h
src/ServerProcess.cpp
src/resources/resources.qrc
)
add_executable(CommonwealthOnlineHost ${PROJECT_SOURCES})
target_link_libraries(CommonwealthOnlineHost
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Network
Qt6::Concurrent
)
# Windows-specific settings
if(WIN32)
set_target_properties(CommonwealthOnlineHost PROPERTIES
WIN32_EXECUTABLE ON
VS_DPI_AWARE "ON"
)
# Set application icon
target_sources(CommonwealthOnlineHost PRIVATE src/resources/app.rc)
endif()
# Set output directory
set_target_properties(CommonwealthOnlineHost PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)