You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Qt+CMake+CPack在Windows打包失败:GitHub Actions部署报错

GitHub Actions打包Qt C++应用Windows平台CMake错误

我正在通过GitHub Actions打包发布C++ Qt应用,对应的发布流程在Linux上运行正常,但在Windows平台执行时出现如下错误:

CPack: Create package using ZIP
CPack: Install projects
CPack: - Install project: MarkdownEdit [Release]
CMake Error at D:/a/MarkdownEdit/MarkdownEdit/build/cmake_install.cmake:55 (include):
  include could not find requested file:

    D:/a/MarkdownEdit/MarkdownEdit/build/.qt/deploy_markdownedit_b3a8f1ec09-$<CONFIG>.cmake

我推测问题与这段CMake代码有关:

if(${QT_VERSION} GREATER_EQUAL 6.3 AND NOT FLATPAK)
    qt_generate_deploy_app_script(
        TARGET markdownedit
        FILENAME_VARIABLE deploy_script
        NO_UNSUPPORTED_PLATFORM_ERROR
    )
    install(SCRIPT ${deploy_script})
endif()

需要说明的是,我日常不使用Windows,仅通过虚拟机测试,但在虚拟机中无法复现该问题,当前Windows环境使用的是Qt 6.5.1版本。

内容的提问来源于stack exchange,提问作者Tim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 00:37:15