[Qt-creator] Add a Build for Distribution menu choice to QtCreator

Henry Skoglund fromqt at tungware.se
Sun Apr 6 20:09:15 CEST 2014


I've been using QtCreator since last year and it's an excellent IDE and 
project tool. However once you leave the safe haven of your dev. PC, 
i.e. you want to deploy your fancy app to other PCs without Qt, some 
pain can ensue. Especially if you, like me, are a "Qt rookie".

For Windows, you can run the utility windeployqt and for Macs there is 
macdeployqt which is *really* useful (I know, I sat many hours typing 
"install_name_tool -change xxx yyy" until I learned about macdeployt on 
qt-project.org's forum.) For Linux though, there is no linuxdeployqt :-(

However windeployqt leaves you a bit stranded, since it doesn't copy 
compiler specific DLLs like msvcr120.dll etc. And on the Mac, if you try 
run the Qt app in a folder that's been macdeployqt'ed on your 
development Mac you'll get the double Qt syndrome.

All of this you'll eventually learn, not really a showstopper. But I 
think it's possible for QtCreator to more helpful here, by including a 
*Build for Distribution* menu choice.

The way I envision it: build for distribution creates a folder prefixed 
with "dist-" or "distribute-" instead of "build-" (obviously requiring 
shadow builds to be enabled). It then compiles in Release Mode, perhaps 
first creating new files in the normal release folder. Then deletes 
possible prev. "dist-xxx" folder, creates a new "dist-xxx" one and 
copies the newly built app file, invokes windeployqt/macdeployqt on that 
folder or in case of Linux, copies the needed Qt files into it and 
invokes chrpath -r $ORIGIN on the app.elf file.
And for Windows, copies the MinGW or MSVC compiler specific files (which 
ones could be specified in mkspecs).

Rgrds Henry

More information about the Qt-creator mailing list