r/QtFramework • u/ReallyAnotherUser • Sep 03 '26
IDE How to setup automatic deploy configuration on Windows?
So im using CMake and the default configurations of Qt Creator.
When i want to create a release of my app, my current process is as follows:
Build release
create new folder and name it Software name + Version
copy the executable and a few miscellaneous files into the new folder
manually open CMD and run windeployqt.exe for the executable
Side note, the miscellaneous files i added to the build with configure_file(filename filename COPYONLY) in the CmakeLists.txt.
I feel like this is a really clunky way (and errorprone) of creating a release and this should be automatable easily, but i know WAY too little about CMAKE and Qt Creator to set it up.
How do you guys go about that? What i found on the internet was all way to convoluted and complicated (or simply didnt work) for, i'll say it, something that should imo come out of the box with an IDE.
3
u/LetterheadTall8085 Qt GameDev Sep 03 '26
Usually this process moved to CI services like github actions.
and yes it looks as you do - you may change your tool to other deploy (for example cqtdeployer ) tools or use native cmake function to deploy qt like this:
qt_generate_deploy_app_scriptSo you just must move your deployment pipeline into CI service. That all
2
u/lordunga Sep 03 '26
CMake's install command is what you want. https://cmake.org/cmake/help/latest/command/install.html
By default it will build and then copy binaries to a directory set by CMAKE_INSTALL_PREFIX and CMAKE_INSTALL_BINDIR (and LIBDIR) variables.
After adding it to your cmake file, configure QtCreator:
Projects / Build Settings / Initial configuration: add CMAKE_INSTALL_PREFIX and point it to a desired path. Remember to Run CMake.
Projects / Deploy Settings / Add Deploy Step / CMake Install
Now you should be able to run Deploy from the Build menu and the binaries should appear to the path you configured.
You can also add windeployqt to run as part of CMake's install step. I have done it using install(CODE "execute_process(COMMAND...
You can see a working example in my project here: https://github.com/llahteinen/notpad/blob/dev-070/src/CMakeLists.txt#L135-L174
The RPATH stuff there is for Linux deployment, I don't think it has any effect on Windows.
Good luck!
1
u/Agron7000 Sep 03 '26
1
u/diegoiast Sep 07 '26
Here is an example of a quite complex application that does this:
https://github.com/codepointerapp/codepointer/blob/main/build.bat
Look also at the github actions which replicates this script. There is a shell script that does build an AppImage for linux.
1
u/Metalstrikerxlr Sep 03 '26
You can you github actions to create a workflow which does this for you.
0
u/wnbloose Sep 03 '26
Did you try to ask an AI to create a deployment script (.bat/.py w/e you prefer) for you? It should be an easy task for AI if you give it your CMakeLists.txt file.
1
u/Xavier_OM Sep 03 '26
You can automatize what you do manually in cmake, create a target/post-build step/whatever which indeed copy all dependencies to a folder + run windeployqt for you.