Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMake variables
QtWS25 Last Chance

QMake variables

Scheduled Pinned Locked Moved General and Desktop
environment varqmakewindowsmingw
8 Posts 2 Posters 4.3k Views
  • 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.
  • M Offline
    M Offline
    Michael Sumulong
    wrote on last edited by
    #1

    I'm currently developing in Qt 5.5.0 w/ the MinGW version in Windows. In my .pro file, I'd like to know where the MinGW toolchain is installed (ie. C:\Qt\Qt5.5.0\Tools\mingw492_32\bin) but I can't seem to find an environment variable that points to it...

    I've only been able to find these QMAKE variables:

    c:\Qt\Qt5.5.0\5.5\mingw492_32\bin>qmake.exe -query
    QT_SYSROOT:
    QT_INSTALL_PREFIX:C:/Qt/Qt5.5.0/5.5/mingw492_32
    QT_INSTALL_ARCHDATA:C:/Qt/Qt5.5.0/5.5/mingw492_32
    QT_INSTALL_DATA:C:/Qt/Qt5.5.0/5.5/mingw492_32
    QT_INSTALL_DOCS:C:/Qt/Qt5.5.0/Docs/Qt-5.5
    QT_INSTALL_HEADERS:C:/Qt/Qt5.5.0/5.5/mingw492_32/include
    QT_INSTALL_LIBS:C:/Qt/Qt5.5.0/5.5/mingw492_32/lib
    QT_INSTALL_LIBEXECS:C:/Qt/Qt5.5.0/5.5/mingw492_32/bin
    QT_INSTALL_BINS:C:/Qt/Qt5.5.0/5.5/mingw492_32/bin
    QT_INSTALL_TESTS:C:/Qt/Qt5.5.0/5.5/mingw492_32/tests
    QT_INSTALL_PLUGINS:C:/Qt/Qt5.5.0/5.5/mingw492_32/plugins
    QT_INSTALL_IMPORTS:C:/Qt/Qt5.5.0/5.5/mingw492_32/imports
    QT_INSTALL_QML:C:/Qt/Qt5.5.0/5.5/mingw492_32/qml
    QT_INSTALL_TRANSLATIONS:C:/Qt/Qt5.5.0/5.5/mingw492_32/translations
    QT_INSTALL_CONFIGURATION:
    QT_INSTALL_EXAMPLES:C:/Qt/Qt5.5.0/Examples/Qt-5.5
    QT_INSTALL_DEMOS:C:/Qt/Qt5.5.0/Examples/Qt-5.5
    QT_HOST_PREFIX:C:/Qt/Qt5.5.0/5.5/mingw492_32
    QT_HOST_DATA:C:/Qt/Qt5.5.0/5.5/mingw492_32
    QT_HOST_BINS:C:/Qt/Qt5.5.0/5.5/mingw492_32/bin
    QT_HOST_LIBS:C:/Qt/Qt5.5.0/5.5/mingw492_32/lib
    QMAKE_SPEC:win32-g++
    QMAKE_XSPEC:win32-g++
    QMAKE_VERSION:3.0
    QT_VERSION:5.5.0
    

    Is there anywhere else I can look?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      There's no pre-made Qt variable for that.

      Out of curiosity, why do you need that ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        There's no pre-made Qt variable for that.

        Out of curiosity, why do you need that ?

        M Offline
        M Offline
        Michael Sumulong
        wrote on last edited by Michael Sumulong
        #3

        @SGaist I'm currently using protobuf in my application and I use MSYS & Qt's MinGW toolchain to compile protobuf.
        Using a .pri file similar to this: https://github.com/bitcoin/bitcoin/blob/master/share/qt/protobuf.pri

        Compiling protobuf under MSYS places the protoc.exe compiler in C:\Qt\Qt5.5.0\Tools\mingw492_32\bin. I'd like to have a way of not hard coding the path because some team members may not be at the same Qt version.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If don't have a windows with MinGW at hand but check the Build panel for the PATH environment variable, this one will probably contain C:\Qt\Qt5.5.0\Tools\mingw492_32\binso you don't need to set a particular path from your pro file.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            If don't have a windows with MinGW at hand but check the Build panel for the PATH environment variable, this one will probably contain C:\Qt\Qt5.5.0\Tools\mingw492_32\binso you don't need to set a particular path from your pro file.

            M Offline
            M Offline
            Michael Sumulong
            wrote on last edited by
            #5

            @SGaist Yea, I did see that but I use the following to test to make sure protoc.exe exists (using a hard-coded path):

            win32:PROTOC_FILENAME=protoc.exe
            unix:PROTOC_FILENAME=protoc
            PROTOC = C:/Qt/Qt5.5.0/Tools/mingw492_32/bin/$$PROTOC_FILENAME
            exists( $$PROTOC )
            

            I'm not certain how to go about using PATH to look for the protoc executable.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That's the thing, since the build environment PATH variable contains the path for MinGW, you shouldn't need the full path to protoc.exe

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 1 Reply Last reply
              0
              • SGaistS SGaist

                That's the thing, since the build environment PATH variable contains the path for MinGW, you shouldn't need the full path to protoc.exe

                M Offline
                M Offline
                Michael Sumulong
                wrote on last edited by
                #7

                @SGaist I understand that protoc.exe will run since it's in the PATH. My problem is that I want to be able to make sure it is installed in the system first. The exists() function doesn't seem like it uses the PATH environment variable and requires and absolute full path to protoc.exe. I think my only solution is to iterate through each entry in PATH and test for protoc.exe that way.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You could also try with system

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

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