[Interest] qmake Conditions and Scopes

Szalata, Zenon M. zms at slac.stanford.edu
Mon Mar 12 18:54:07 CET 2012


Thank you for your suggestion.  It is something that I can use.
Zen

> -----Original Message-----
> From: interest-bounces+zms=slac.stanford.edu at qt-project.org
> [mailto:interest-bounces+zms=slac.stanford.edu at qt-project.org] On Behalf Of
> Lincoln Ramsay
> Sent: Sunday, March 11, 2012 10:13 PM
> To: interest at qt-project.org
> Subject: Re: [Interest] qmake Conditions and Scopes
> 
> On 03/12/2012 02:33 PM, ext Szalata, Zenon M. wrote:
> > I took this from qmake Advanced Usage available in assistant.
> 
> It's terribly limiting to make decisions based on the mkspec and almost
> always wrong (even when Qt does it). We've turned up bugs by failing to
> name custom mkspecs in precisely the way Qt's build system assumes
> they're named.
> 
> > That fragment does not work. In fact only the first call to message prints
> > which seems to mean that the variable QMAKESPEC has null value and the
> > two conditions are not met.
> 
> Or it's something else that is perfectly valid but doesn't match either
> of those two (like say, linux-g++).
> 
> > How can I implement such conditional building based on the host
> > architecture?
> 
> Test for it. Properly.
> 
> If you want to know what the toolchain will produce, ask it (ie. compile
> something that can tell you if it's 32 or 64 bits when run or maybe
> examine the binary if you can't run the binaries produced by the toolchain).
> 
> If you want to know what architecture your host machine is, ask it
> (perhaps with uname -a).
> 
> Then use your results to write a file qmake can read.
> 
> eg.
> echo bits=$bits >config.pri
> 
> foo.pro:
> include(config.pri)
> equals(bits,32) {
>      # 32-bit
> } else:equals(bits,64) {
>      # 64-bit
> } else {
>      # error
> }
> 
> 
> --
> Lincoln Ramsay - Senior Software Engineer
> Qt Development Frameworks, Nokia - http://qt.nokia.com/
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list