QMake and resources



  • Hi,

    I'm using on my application a binary resource, this is compiled using:

    @$ rcc -binary -no-compress myResource.qrc -o myResource.rcc@

    Then I copy the *.rcc to ${BUILD_PATH}/share folder. (¬¬ using cp $path_to_myResource path_to_mySharedFolder).

    The question is:

    How can I configure my *.pro file for let do this work (compile the resource file) to qmake tool?

    @# I've tried to use
    CONFIG += resources

    ...

    QMAKE_RESOURCE_FLAGS += -no-compress -binary
    @

    Thank your for your help.



  • Just adding
    @
    RESOURCES += <resource>.qrc
    @

    should do.



  • [quote author="Tomma" date="1343370146"]Just adding
    @
    RESOURCES += <resource>.qrc
    @

    should do.[/quote]

    Yes Tomma, that's correct. All resource file must be added to RESOURCES variable.

    But how can I tell to qmake: Over this resource use rcc -binary -no-compress resource.qrc -o resourceOutput.rcc



  • QMake variable:
    @
    QMAKE_POST_LINK
    @

    You can create script which will make rcc file and copy to destination folder. Next you should add this script in QMAKE_POST_LINK. Don't forget to no add your qrc file to RESOURCES if you want load rcc dynamicly. Sorry for my flawed English.



  • [quote author="Hostel" date="1343414031"]QMake variable:
    @
    QMAKE_POST_LINK
    @
    [/quote]

    Thank you Hoste, that is a good solution, I have only one problem, create each script to be used on each platform.

    PD: You make me look in google translate for word flawed :P

    Best regards,



  • In near future I will use QMAKE_POST_LINK in my .pro file for creating rcc by script and I think that I will use Python - it's cross platform.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.