Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qmake: List of special platform variables
Forum Updated to NodeBB v4.3 + New Features

Qmake: List of special platform variables

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 6 Posters 26.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

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

    ddImmersiveHPD 1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      See $QTDIR/mkspecs.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        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

        @
        win32 {
        }
        or
        win64 {
        }
        @

        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]

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          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)

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              Nope, there's no "win" variable/scope. You can simulate this way:

              @
              win32:CONFIG += win
              win64:CONFIG += win
              win:messag(in scope win)
              win32:messag(in scope win32)
              win32-g++:messag(in scope win32-g++)
              win32-msvc2008:messag(in scope win32-msvc2008)
              @

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

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Asperamanca
                wrote on last edited by
                #7

                Okay, thanks!

                1 Reply Last reply
                0
                • X Offline
                  X Offline
                  xchg.ca
                  wrote on last edited by
                  #8

                  Guys I have issue that my qmake prints: unix on my Win7 machine

                  @win32 {
                  message(win32)
                  }
                  win64 {
                  message(win64)
                  }
                  macx {
                  message(macx)
                  }
                  unix:!macx{
                  message(unix)
                  }@

                  Any idea what that can be?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andreyc
                    wrote on last edited by
                    #9

                    According you your other "thread":http://qt-project.org/forums/viewthread/47332/ it happens because your target platform is Unix.

                    1 Reply Last reply
                    0
                    • A Asperamanca

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

                      ddImmersiveHPD Offline
                      ddImmersiveHPD Offline
                      ddImmersiveHP
                      wrote on last edited by
                      #10

                      @Asperamanca, I grep'd through mkspecs, and this is what I have in one of my qt 5.5 installations' mkspec folder:

                      $ grep -E -o -r 'QMAKE_PLATFORM.*?$'
                      
                      aix-g++/qmake.conf:		QMAKE_PLATFORM          = aix
                      aix-g++-64/qmake.conf:		QMAKE_PLATFORM          = aix
                      aix-xlc/qmake.conf:		QMAKE_PLATFORM          = aix
                      aix-xlc-64/qmake.conf:		QMAKE_PLATFORM          = aix
                      android-g++/qmake.conf:		QMAKE_PLATFORM          = android
                      blackberry-armle-v7-qcc/qmake.conf:		QMAKE_PLATFORM += blackberry
                      blackberry-x86-qcc/qmake.conf:		QMAKE_PLATFORM += blackberry
                      common/ios.conf:		QMAKE_PLATFORM         += ios
                      common/linux-android.conf:		QMAKE_PLATFORM         += android
                      common/linux.conf:		QMAKE_PLATFORM         += linux
                      common/mac.conf:		QMAKE_PLATFORM         += mac darwin
                      common/macx.conf:		QMAKE_PLATFORM         += osx macx
                      common/msvc-desktop.conf:		QMAKE_PLATFORM          = win32
                      common/nacl/nacl-base.conf:		QMAKE_PLATFORM          = nacl $$QMAKE_PLATFORM
                      common/qcc-base-qnx.conf:		QMAKE_PLATFORM         += qnx
                      common/unix.conf:		QMAKE_PLATFORM         += unix posix
                      common/wince/qmake.conf:		QMAKE_PLATFORM         += wince win32
                      common/winrt_winphone/qmake.conf:		QMAKE_PLATFORM          = winrt win32
                      cygwin-g++/qmake.conf:		QMAKE_PLATFORM          = cygwin unix posix
                      darwin-g++/qmake.conf:		QMAKE_PLATFORM          = osx macx mac darwin
                      features/spec_post.prf:		QMAKE_PLATFORM) {
                      features/spec_post.prf:		QMAKE_PLATFORM = unix
                      features/spec_post.prf:		QMAKE_PLATFORM = osx macx mac darwin unix
                      features/spec_post.prf:		QMAKE_PLATFORM = win32
                      features/spec_post.prf:		QMAKE_PLATFORM, macx):!contains(QMAKE_PLATFORM, osx) {
                      features/spec_post.prf:		QMAKE_PLATFORM = osx $$QMAKE_PLATFORM
                      features/spec_post.prf:		QMAKE_PLATFORM
                      freebsd-g++/qmake.conf:		QMAKE_PLATFORM          = freebsd bsd
                      freebsd-g++46/qmake.conf:		QMAKE_PLATFORM          = freebsd bsd
                      freebsd-icc/qmake.conf:		QMAKE_PLATFORM          = freebsd bsd
                      haiku-g++/qmake.conf:		QMAKE_PLATFORM          = haiku
                      hpux-acc/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpux-acc-64/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpux-acc-o64/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpux-g++/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpux-g++-64/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpuxi-acc-32/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpuxi-acc-64/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hpuxi-g++-64/qmake.conf:		QMAKE_PLATFORM          = hpux
                      hurd-g++/qmake.conf:		QMAKE_PLATFORM         += hurd
                      irix-cc/qmake.conf:		QMAKE_PLATFORM          = irix
                      irix-cc-64/qmake.conf:		QMAKE_PLATFORM          = irix
                      irix-g++/qmake.conf:		QMAKE_PLATFORM          = irix
                      irix-g++-64/qmake.conf:		QMAKE_PLATFORM          = irix
                      linux-cxx/qmake.conf:		QMAKE_PLATFORM          = linux
                      linux-kcc/qmake.conf:		QMAKE_PLATFORM          = linux
                      linux-pgcc/qmake.conf:		QMAKE_PLATFORM          = linux
                      lynxos-g++/qmake.conf:		QMAKE_PLATFORM          = lynxos
                      netbsd-g++/qmake.conf:		QMAKE_PLATFORM          = netbsd bsd
                      openbsd-g++/qmake.conf:		QMAKE_PLATFORM          = openbsd bsd
                      sco-cc/qmake.conf:		QMAKE_PLATFORM          = sco
                      sco-g++/qmake.conf:		QMAKE_PLATFORM          = sco
                      solaris-cc/qmake.conf:		QMAKE_PLATFORM          = solaris
                      solaris-cc-64/qmake.conf:		QMAKE_PLATFORM          = solaris
                      solaris-g++/qmake.conf:		QMAKE_PLATFORM          = solaris
                      solaris-g++-64/qmake.conf:		QMAKE_PLATFORM          = solaris
                      tru64-cxx/qmake.conf:		QMAKE_PLATFORM          = tru64
                      tru64-g++/qmake.conf:		QMAKE_PLATFORM          = tru64
                      unixware-cc/qmake.conf:		QMAKE_PLATFORM          = unixware
                      unixware-g++/qmake.conf:		QMAKE_PLATFORM          = unixware
                      unsupported/freebsd-clang/qmake.conf:		QMAKE_PLATFORM          = freebsd bsd
                      unsupported/linux-host-g++/qmake.conf:		QMAKE_PLATFORM          = linux
                      unsupported/qnx-X11-g++/qmake.conf:		QMAKE_PLATFORM          = qnx
                      unsupported/vxworks-ppc-dcc/qmake.conf:		QMAKE_PLATFORM          = vxworks
                      unsupported/vxworks-ppc-g++/qmake.conf:		QMAKE_PLATFORM          = vxworks
                      unsupported/vxworks-simpentium-dcc/qmake.conf:		QMAKE_PLATFORM          = vxworks
                      unsupported/vxworks-simpentium-g++/qmake.conf:		QMAKE_PLATFORM          = vxworks
                      win32-g++/qmake.conf:		QMAKE_PLATFORM          = win32 mingw
                      win32-icc/qmake.conf:		QMAKE_PLATFORM          = win32
                      winphone-arm-msvc2013/qmake.conf:		QMAKE_PLATFORM          = winphone $$QMAKE_PLATFORM
                      winphone-x86-msvc2013/qmake.conf:		QMAKE_PLATFORM          = winphone $$QMAKE_PLATFORM
                      
                      1 Reply Last reply
                      2

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved