Difference between revisions of "Packaging Qt apps for Mac OS X"
(→Application and package icon) |
(→Application and package icon) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
# Build your application in release mode | # Build your application in release mode | ||
− | # Execute "macdeployqt myprog.app" | + | # Execute "macdeployqt myprog.app" |
+ | #* see -h for options | ||
+ | #* good to use -verbose=2 | ||
This will bundle all the Qt libraries into the myprog.app - this will be approximately 40 MB. I guess one could still do the manual process for small applications that do not need all the Qt libraries. Or maybe the unnecessary libraries can be removed again manually? | This will bundle all the Qt libraries into the myprog.app - this will be approximately 40 MB. I guess one could still do the manual process for small applications that do not need all the Qt libraries. Or maybe the unnecessary libraries can be removed again manually? | ||
Line 8: | Line 10: | ||
''Note: http://doc.qt.nokia.com/4.7/mac-differences.html#bundle-based-libraries'' | ''Note: http://doc.qt.nokia.com/4.7/mac-differences.html#bundle-based-libraries'' | ||
− | To create a .dmg we can either use the -dmg option to macdeployqt or use the Mac Disk Utility as described [http://mac101.net/content/how-to/how-to-create-dmg-art-for-fancy-application-installations/ here] or [http://mac101.net/content/how-to/security-create-encrypted-dmg-disk-images-sensative-data/ here] (without the encryption part). | + | To create a .dmg we can either use the -dmg option to macdeployqt or use the Mac Disk Utility as described [http://mac101.net/content/how-to/how-to-create-dmg-art-for-fancy-application-installations/ here] or [http://mac101.net/content/how-to/security-create-encrypted-dmg-disk-images-sensative-data/ here] (without the encryption part). In the most basic form: |
+ | # Move myprog.app and all other files into a directory | ||
+ | # Start Disk Utility | ||
+ | # Select File → New → Disk Image from Folder | ||
+ | #* Image Format: compressed | ||
+ | #* Encryption: none | ||
+ | #* Other choices may work as well. | ||
== Application and package icon == | == Application and package icon == | ||
− | # Create an icon with size | + | '''Need update, but can still use Icon Composer 2x''' |
+ | |||
+ | # Create an icon with size 1024x1024 pixels | ||
#* Format can be tiff, png, ... | #* Format can be tiff, png, ... | ||
#* Best from SVG (try http://commons.wikimedia.org) | #* Best from SVG (try http://commons.wikimedia.org) | ||
Line 30: | Line 40: | ||
During runtime the dock icon can be changed by calling [http://doc.qt.nokia.com/4.7/qwidget.html#windowIcon-prop QWidget::setWindowIcon()] on the main window<ref>[http://doc.qt.nokia.com/4.7/qtmac-as-native.html Qt is Mac OS X Native]</ref>. | During runtime the dock icon can be changed by calling [http://doc.qt.nokia.com/4.7/qwidget.html#windowIcon-prop QWidget::setWindowIcon()] on the main window<ref>[http://doc.qt.nokia.com/4.7/qtmac-as-native.html Qt is Mac OS X Native]</ref>. | ||
− | == Including | + | == Including additional data == |
How? | How? | ||
Line 40: | Line 50: | ||
[http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1 Bundle Programming Guide] | [http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1 Bundle Programming Guide] | ||
+ | Related article: [[Building GNU Radio on Mac OS X]]. | ||
[[Category:Software]] | [[Category:Software]] |
Latest revision as of 19:04, 8 August 2013
Once you got tired of reading and trying to comprehend Deploying an Application on Mac OS X in the Qt documentation, you realize at the bottom of the page that all you have to do is:
- Build your application in release mode
- Execute "macdeployqt myprog.app"
- see -h for options
- good to use -verbose=2
This will bundle all the Qt libraries into the myprog.app - this will be approximately 40 MB. I guess one could still do the manual process for small applications that do not need all the Qt libraries. Or maybe the unnecessary libraries can be removed again manually?
Note: http://doc.qt.nokia.com/4.7/mac-differences.html#bundle-based-libraries
To create a .dmg we can either use the -dmg option to macdeployqt or use the Mac Disk Utility as described here or here (without the encryption part). In the most basic form:
- Move myprog.app and all other files into a directory
- Start Disk Utility
- Select File → New → Disk Image from Folder
- Image Format: compressed
- Encryption: none
- Other choices may work as well.
Application and package icon
Need update, but can still use Icon Composer 2x
- Create an icon with size 1024x1024 pixels
- Format can be tiff, png, ...
- Best from SVG (try http://commons.wikimedia.org)
- Drag and drop it into Icon Composer
- Start with the largest one, then drag it to smaller ones.
- Save .icns file
- Note: Icon Composer can also create .ico file but these use different sizes
- Edit project.pro and add: ICON = path/to/icons.icns[1]
- Ejoy the results:
Note: We can also copy and paste .icns files in/out of the bundle and edit the .plist file.
During runtime the dock icon can be changed by calling QWidget::setWindowIcon() on the main window[3].
Including additional data
How?
References
Related article: Building GNU Radio on Mac OS X.