November 18, 2011

Asperamanca Asperamanca
Hobby Entomologist
371 posts

qmake: List of special platform variables

 

Where can I find a documented list of qmake’s platform and compiler variables, like:
win32
win64
unix
win32-msvc

6 replies

November 18, 2011

Lukas Geyer Lukas Geyer
Gene Splicer
2074 posts

See $QTDIR/mkspecs.

November 18, 2011

Asperamanca Asperamanca
Hobby Entomologist
371 posts

The list I get from the folder names in there seems to be incomplete. They do not include e.g. “win32” or “win64” without specifying a specific compiler.

However, I can still use

  1.  
  2. win32 {
  3. }
  4. or
  5. win64 {
  6. }

in a .pro file.

Where is that documented?

(Specifically, I am looking for a single common variable for “Windows” in general, whether it be 32 or 64 bit).

[EDIT: code formatting, please wrap in @-tags, Volker]

November 18, 2011

Volker Volker
Robot Herder
5428 posts

The platform variables resemble closely to the mkspec variants, so for example

  • for a mac, it matches at lesat on unix, macx and one of (macx-g++, macx-g++40, macx-g++42)
  • for windows it matches at least on win32 and one of (win32-g++ or win32-msvc20xx)

November 18, 2011

Asperamanca Asperamanca
Hobby Entomologist
371 posts

But there does not seem to be any “win” matching both win32 and win64, or is there?

November 18, 2011

Volker Volker
Robot Herder
5428 posts

Nope, there’s no “win” variable/scope. You can simulate this way:

  1. win32:CONFIG += win
  2. win64:CONFIG += win
  3. win:messag(in scope win)
  4. win32:messag(in scope win32)
  5. win32-g++:messag(in scope win32-g++)
  6. win32-msvc2008:messag(in scope win32-msvc2008)

This prints “win” too, without the first two lines it does not.

November 21, 2011

Asperamanca Asperamanca
Hobby Entomologist
371 posts

Okay, thanks!

 
  ‹‹ [Moved] QMAKE or Qt Creator set up for bigger project...      gdb in qtcreator does’n stop in any breakepoint - win 7 64bits ››

You must log in to post a reply. Not a member yet? Register here!