Search code examples
macosqtqmake

qmake and osx bundles


I want to place some extra information (text files, background pic or others) to an .app-bundle and then access these items from QT. Ok, it is possible to add them using the resource files, but I want to give the user the ability to change the contents relatively easy. The working approach is to do it manually - which is working. However, more beneficial would be if I could do this directly from the qmake .pro files. How do I do this in an elegant way?


Solution

  • Use QMAKE_BUNDLE_DATA:

    RESFILES.files = background.png copyright.txt
    RESFILES.path = Contents/Resources
    QMAKE_BUNDLE_DATA += RESFILES