[Qt-interest] qmake "-=" operator on the command line

Nikos Chantziaras realnc at arcor.de
Sun May 29 20:29:14 CEST 2011


On 05/29/2011 07:08 PM, Thiago Macieira wrote:
> On Sunday, 29 de May de 2011 17:28:26 Nikos Chantziaras wrote:
>> Is the following supposed to work?
>>
>>     qmake CONFIG-=warn_off myproject.pro
>>
>> Because it doesn't.  "+=" works fine, it's only "-=" that doesn't.
> [...]
> However, the command you ran probably works just fine. It's your expectation of
> what it does that is incorrect. I'm sure qmake removed any "warn_off"
> configuration that was active. The questions you have to ask are:
>
> 1) at what point is any "warn_off" introduced, relative to the processing of
> the command-line? before, after or never?
>
> 2) could it be that the warnings are disabled because nothing enables it?
> Removing an option that resets to the default when the default is already
> active is a no-op.
>
> For more information, run:
> 	qmake -d -d CONFIG-=warn_off myproject.pro
>
> And search for "warn_off" in the output. You'll be able to answer both
> questions.

Thanks.  This clears things up.  qmake does indeed process the "-=", but 
does so before processing whatever is in the project file.  Bo's 
suggestion of using the "-after" flag makes "-=" work as expected; or 
rather, more intuitive.

I say "intuitive" since what most people would expect (I guess) is for 
-= to remove something that was set in the project file but without the 
need to edit it.  IMO this should be the default anyway, since 
command-line options usually have the highest priority over anything 
else (not a qmake-specific observation, but general Unix philosophy, 
where you have hard-coded defaults, conf files, env vars, and 
command-line options, in that order.)



More information about the Qt-interest-old mailing list