Running windeployqt from QtCreator
-
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.
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. -
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.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.cmakethat 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.
-
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.cmakethat 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.