0

I'm trying to package and release my C++ Qt app using GitHub Actions. I'm using a release workflow to do this. It works fine on Linux, but on Windows I get the following error:

  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

I think this has something to do with

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()

But unfortunately, I can't reproduce the problem in a VM (I don't use Windows, so a VM)

On Windows, I'm using Qt 6.5.1

Tim
  • 406
  • 3
  • 14
  • 1
    Seems the variable ‘ $’ is not being expanded in windows. If this doesn’t get solved in the next few hours I’ll have some more time to look. – Louis Langholtz Aug 30 '23 at 15:56

1 Answers1

2

There isn't enough info in the question to give a concrete answer. However, I think I can give some useful advice.

This doesn't look like a Windows issues. It looks like your CMake code doesn't handle multi-configuration generators properly.

As mentioned by Louis the generator expression isn't expanding.

Since you are only on linux a good way to try and repro the issue is to use the Ninja Multi-Config generator.

https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html

So try reproducing the problem by specifying the generator.

cmake -S . -B build -G "Ninja Multi-Config" ...

A possible workaround to avoid handling multi-config generators is to just use Ninja on all platforms. If this works then your problem is related to some minor problem in your CMake code.

You will want to setup the developer command prompt though if you are using Ninja on Windows:

How to setup visual studio developer command prompt on GitHub Actions?

jpr42
  • 718
  • 3
  • 14
  • 1
    Wow, by using Ninja it now works! Thank you, a lot! Also thank you for linking to the tutorial! – Tim Aug 30 '23 at 21:49