Important: Please read the Qt Code of Conduct -

Momentics: adding a global define to a buildconfiguration

  • Hi,

    hopefully somebody already has worked this out...

    I'm trying to add more build configurations to my app, so that I can build it for several flavors.
    For now, I am looking how to add certain defines to this build configuration, either though momentics or through qmake.
    For now I can add the define to all configs, but the build configurations in Momentics seem not to reflect in qmake.
    Also adding a build variable did not work, could I query for this somehow in qmake?

    Anyone has solved this?

  • So I got a working solution.

    First the bad part: that isn't possible over the IDE.
    You will need to add a new buildtarget.

    First in the pro file, myconfig{ DEFINES += MYDEFINE } will add the define in this configuration.

    Next thing is to copy the make targets from mk/ (in target/.../include folder).

    for example:
    Device-Debug-myconfig:arm/Makefile-myconfig //then copypaste of
    Device-Debug rule

    arm/Makefile-myconfig:/* copy paste arm/Makefile rule*/
    add CONFIG+=myconfig ...

    Now, you are setup, last thing is to change the make build target of you build configuration to the new Device-Debug-myconfig rule.

    Repeat for every build configuration and needed make-target.

    Thanks to Elena Laskavaia for pointing me at this solution :)

Log in to reply