Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137763

windeployqt crash when run through cmake

    XMLWordPrintable

Details

    • Windows
    • ada927d19 (dev), 9262ce1b2 (6.10), 74ec66d57 (6.9)

    Description

      Hello,

      I recently update to 6.9.1 from 6.8.0 and now my installation script is crashing. (edit: just tried 6.8.3, it works)

      I use cmake, my project has several subproject/dependencies. And I use the deploy tool like this:

      install(TARGETS MyLib 
          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 
      )
      qt_generate_deploy_app_script(
          TARGET MyLib
          OUTPUT_SCRIPT deploy_script
          NO_TRANSLATIONS
      )
      install(SCRIPT ${deploy_script}) 

       And when I try to install, either from visual studio directly or from command line cmake. I get this:

      -- Installing: C:/Git/MySoftware/out/install/x64-Release/bin/MyLib.dll
      -- Writing C:/Git/MySoftware/out/install/x64-Release/bin/qt.conf
      -- Running Qt deploy tool for C:/Git/MySoftware/out/build/x64-Release/bin/MyLib.dll in working directory 'C:/Git/MySoftware/out/install/x64-Release'
      'C:/Qt/6.9.1/msvc2022_64/bin/windeployqt.exe' 'C:/Git/MySoftware/out/build/x64-Release/bin/MyLib.dll' '--dir' '.' '--libdir' 'bin' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--no-translations' '--qtpaths' 'C:/Qt/6.9.1/msvc2022_64/bin/qtpaths6.exe'
      CMake Error at C:/Qt/6.9.1/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:542 (message):
        Executing C:/Qt/6.9.1/msvc2022_64/bin/windeployqt.exe failed: Exit code
        0xc0000409Call Stack (most recent call first):
        .qt/deploy_MyLib_e7dc6e7583.cmake:5 (qt6_deploy_runtime_dependencies)
        MySoftware/MyLib/cmake_install.cmake:40 (include)
        MySoftware/cmake_install.cmake:62 (include)
        cmake_install.cmake:47 (include)
      FAILED: CMakeFiles/install.util 
      C:\WINDOWS\system32\cmd.exe /C "cd /D C:\Git\MySoftware\out\build\x64-Release && "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -P cmake_install.cmake"
      ninja: build stopped: subcommand failed.

      I have several libraries deployed this way. It does not always happen on the same library.

      It happens on my windows 11 machine, and on our build server too. No issue on linux (ubuntu 22.04)

       

      I tried to make a small project that can reproduce the issue, without success

       

      If I run manually the windeployqt command from the command line (i.e. not from cmake install, just the windeployqt), it works.

       

      I will try to locate more precisely the issue and make a small example project. In the meantime, I can provide additional info if needed

      Attachments

        1. image-2025-06-16-16-19-46-712.png
          273 kB
          David Levy
        2. image-2025-06-16-16-21-52-104.png
          107 kB
          David Levy
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            owolff Oliver Wolff
            mwoua David Levy
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes