[Interest] including config file with macdeployqt

Larry Martell larry.martell at gmail.com
Tue May 17 15:18:53 CEST 2016


On Fri, May 13, 2016 at 8:07 AM, Robert Iakobashvili
<coroberti at gmail.com> wrote:
> Sorry, I do not know this way: running macdeployqt
>  is just a step in my script.
>
> You can copy by a post-building script command cp
> or use QMAKE_BUNDLE_DATA in your pro file to copy all
> you need in your app bundle.
>
> Kinda:
>
> SomeFeature.files = ./db/SomeFeature
> SomeFeature.path = Contents/Resources/
> QMAKE_BUNDLE_DATA += SomeFeature

Thanks for the reply. We're not using qmake, and we deploy on both Mac
and Windows. So on Win we're adding the file to the installshield
manifest and on Mac we're copying the file in manually. And in my code
I have this:

#if defined _MSC_VER
#define CONFIG_PATH "Resources/cap_config.json"
#else
#define CONFIG_PATH "../Resources/cap_config.json"
#endif

QFile file(QCoreApplication::applicationDirPath() + "/" + CONFIG_PATH);

I certainly don't love it, but it works.

>
> On Fri, May 13, 2016 at 1:54 PM, Larry Martell <larry.martell at gmail.com> wrote:
>> Thanks. That answers the second part of my question.
>>
>> Is there a way to get the config automagically included when I run macdeployqt?
>>
>> On Fri, May 13, 2016 at 7:50 AM, Robert Iakobashvili
>> <coroberti at gmail.com> wrote:
>>> Dear Larry,
>>> I'd place it to Resources - so no issues at signing.
>>>
>>> Additionally, if you need some configs specific for each Mac-user,
>>> ~/Library/Application Support is the right place to arrange
>>> and entry for your company and inside entries for your software.
>>>
>>> Kind regards,
>>> Robert
>>>
>>>
>>> On Fri, May 13, 2016 at 1:42 PM, Larry Martell <larry.martell at gmail.com> wrote:
>>>> I am creating a bundle with macdeployqt to distribute my app. I want
>>>> to have a config file that my app will read at startup. How can I
>>>> include that config file in my bundle, and where is the proper place
>>>> for it to live on the file system on the machine the app gets
>>>> installed on?
>>>> _______________________________________________
>>>> Interest mailing list
>>>> Interest at qt-project.org
>>>> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list