[Qt-interest] passing in compile flags from qmake

Nikos Chantziaras realnc at arcor.de
Sat Mar 27 01:29:06 CET 2010


On 03/27/2010 01:38 AM, David Boosalis wrote:
> On one platform I have a mysql password set as "passwordA", on the other
> platform I have set to "passwordB". I just comment out one line or the
> other.  Both platforms share the same CVS source code, and although it
> is much to vi the source and comment out the wrong password as
>
> //QString password = "passwordA";
> QString password = "passwordB";
>
> I'd like to add it as a QMake or Make option, so I do not have to edit
> the file.  What I am asking is how do I pass a #define to the compiler
> I invision the source code to look something like this.
>
> #ifdef platfromA
> QString password = "passwordA";
> #else
> QString password = "passwordB";
> #endif
>
> How does one set such a flag in project file ?
>
> Thanks in advance for any help

qmake DEFINES+=platformA



More information about the Qt-interest-old mailing list