QT Tip On Mac

When you are developing QT applications on MacOSX you might want to check a few things before.

The way the applications are put together in MacOSX changes, one example is the DMG file, which contains all the stuff that is needed for your application to run.

One tip for this is that when you are compiling your code from the command line, you add the next line in the .pro file.

1
mac { CONFIG -= app_bundle }

This will remove the “pull all together” mac compiling thingie, and it will create your binary just as it is on the current folder. Just like Linux or any Unix Based project. If you decide not to do this, your app will be located in a new folder created with .app extension. Just like this:

1
myApp.app/Contents/MacOS/myApp

And if you want to create the dmg file you also need to use specific tools build for this, like macdeployqt, which is a tool included in the qt source library(the one you compile from scratch).

Example:

1
macdeployqt icarus-avena.app -dmg

This command will create from the folder the dmg file.(if you did not used the – app_bundle)

And here you will find more information about mac deployment.