vdi-cloud/terminal/kiosk-shell/CMakeLists.txt
宋一鸣 13f645a503 重构:完善串流就绪检测并补充 GPU 联调记录
变更详情:kiosk 会话就绪检测重构(Moonlight 输出解析器/事件化回调/单元测试);GPU 直通实操记录(vfio Subsystem 注入、sysfs vBIOS、7zr+pnputil 安装、566.36 驱动、Sunshine 配对断链修复)
2026-10-30 14:42:11 +08:00

92 lines
2.4 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cmake_minimum_required(VERSION 3.16)
project(kiosk-shell CXX)
# 对应《VDI 云桌面软件开发方案》2.2 节技术栈定版:
# kiosk 用 C/C++/Qt;会话通道统一 Moonlight(RDP 渲染管线已移除,代码存于 git 历史)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# ---- Qt5 ----
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)
include(CTest)
add_executable(kiosk-shell
src/main.cpp
src/main_window.cpp
src/login_page.cpp
src/desktop_list_page.cpp
src/desktop_settings_dialog.cpp
src/desktop_service.cpp
src/desktop_store.cpp
src/moonlight_session.cpp
src/transition_overlay.cpp
src/state_machine.cpp
src/config.cpp
)
target_include_directories(kiosk-shell PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(kiosk-shell PRIVATE
Qt5::Core
Qt5::Gui
Qt5::Widgets
)
# 看门狗 Monitor:独立进程,监控主进程假死/崩溃
add_executable(vdi-kiosk-monitor
src/monitor_main.cpp
src/monitor.cpp
)
target_include_directories(vdi-kiosk-monitor PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
find_package(Threads REQUIRED)
target_link_libraries(vdi-kiosk-monitor PRIVATE Threads::Threads)
if(BUILD_TESTING)
find_package(Qt5 REQUIRED COMPONENTS Test)
add_executable(test-moonlight-session
tests/test_moonlight_session.cpp
src/moonlight_session.cpp
)
target_include_directories(test-moonlight-session PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(test-moonlight-session PRIVATE
Qt5::Core
Qt5::Test
)
add_test(NAME moonlight-session COMMAND test-moonlight-session)
add_executable(test-desktop-list-page
tests/test_desktop_list_page.cpp
src/desktop_list_page.cpp
)
target_include_directories(test-desktop-list-page PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(test-desktop-list-page PRIVATE
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Test
)
add_test(NAME desktop-list-page COMMAND test-desktop-list-page)
set_tests_properties(desktop-list-page PROPERTIES
ENVIRONMENT "QT_QPA_PLATFORM=offscreen"
)
endif()
install(TARGETS kiosk-shell vdi-kiosk-monitor RUNTIME DESTINATION bin)