Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Running windeployqt from QtCreator
Forum Updated to NodeBB v4.3 + New Features

Running windeployqt from QtCreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 470 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Spiel
    wrote on last edited by
    #1

    Is it possible to run windeployqt automatically on build for a CMake project? I find it difficult to manually copy the executable to a directory, then run windeployqt and specify QML directories.

    S 1 Reply Last reply
    0
    • S Spiel

      Is it possible to run windeployqt automatically on build for a CMake project? I find it difficult to manually copy the executable to a directory, then run windeployqt and specify QML directories.

      S Offline
      S Offline
      Spiel
      wrote on last edited by
      #2

      Edit: I tried following the guide at https://www.qt.io/blog/cmake-deployment-api, but when I run cmake.exe --install . --prefix ., I get a failure:
      Unknown CMake command "qt_deploy_qml_imports".

      The same failure appears when using ninja install.

      MesrineM 1 Reply Last reply
      0
      • S Spiel

        Edit: I tried following the guide at https://www.qt.io/blog/cmake-deployment-api, but when I run cmake.exe --install . --prefix ., I get a failure:
        Unknown CMake command "qt_deploy_qml_imports".

        The same failure appears when using ninja install.

        MesrineM Offline
        MesrineM Offline
        Mesrine
        wrote on last edited by Mesrine
        #3

        @Spiel

        I am getting this error also when using the cmake deployment API of Qt.
        For Linux, macOS, and Windows. Qt 6.6.0 and 6.8.0
        I use the same findpackages in two projects and the same cmake template. But deploying the examples for one project works for the other one not.

        The part

        qt_generate_deploy_qml_app_script(
                TARGET quickApp
                OUTPUT_SCRIPT deploy_script
            )
        

        creates a file on the build directory called .qt/QtDeploySupport.cmake that should include

        "SOMEPATH/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake"
         "SOMEPATH/Qt/6.8.0/gcc_64/lib/cmake/Qt6Qml/Qt6QmlDeploySupport.cmake"
        

        but in my case includes only

        "SOMEPATH/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake"
        

        That's why cmake says

        Unknown CMake command "qt_deploy_qml_imports".
        

        because that function is in Qt6QmlDeploySupport.

        MesrineM 1 Reply Last reply
        0
        • MesrineM Mesrine

          @Spiel

          I am getting this error also when using the cmake deployment API of Qt.
          For Linux, macOS, and Windows. Qt 6.6.0 and 6.8.0
          I use the same findpackages in two projects and the same cmake template. But deploying the examples for one project works for the other one not.

          The part

          qt_generate_deploy_qml_app_script(
                  TARGET quickApp
                  OUTPUT_SCRIPT deploy_script
              )
          

          creates a file on the build directory called .qt/QtDeploySupport.cmake that should include

          "SOMEPATH/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake"
           "SOMEPATH/Qt/6.8.0/gcc_64/lib/cmake/Qt6Qml/Qt6QmlDeploySupport.cmake"
          

          but in my case includes only

          "SOMEPATH/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake"
          

          That's why cmake says

          Unknown CMake command "qt_deploy_qml_imports".
          

          because that function is in Qt6QmlDeploySupport.

          MesrineM Offline
          MesrineM Offline
          Mesrine
          wrote on last edited by
          #4

          @Mesrine

          It seems that the FIRST call to findpackage of Qt should have the QML component

          find_package(Qt6 COMPONENTS Core Gui Quick Qml)
          

          Because the qt cmake scripts use that to see what macros to include.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved