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. How to get path to QT includes?
Qt 6.11 is out! See what's new in the release blog

How to get path to QT includes?

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 4.4k 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.
  • N Offline
    N Offline
    nen777w
    wrote on last edited by
    #1

    Is It possible to obtain the path to QT headers in pro file ?
    (i.e. -I"C:\Qt\qt_minGW32_520\qtbase\include" -I"C:\Qt\qt_minGW32_520\qtbase\include\QtPrintSupport" e.t.c)
    I need this for the custom build step.
    The qmake generate this path's (in Make file) for INCPATH variable, but when I do that:

    @message($${INCPATH})@

    It print only user include paths.
    I found that exist the: QMAKE_INCDIR, but message($${QMAKE_INCDIR}) - print the empty string.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @
      message(Header files: $$[QT_INSTALL_HEADERS])
      @
      http://qt-project.org/doc/qt-5/qmake-environment-reference.html

      Edit: I misread your question.
      Qmake builds those simply by iterating over INCLUDEPATH, which has been built up from user and Qt inputs (via feature files like qt.prf and the QT variable)

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nen777w
        wrote on last edited by
        #3

        I know about INCLUDEPATH, but it contain ONLY user path's
        For ensure let's try: message($$INCLUDEPATH)

        message(Header files: $$[QT_INSTALL_HEADERS]) - contain only one path to include directory. In my case it print

        Header files: C:/Qt/qt_minGW32_520/qtbase/include

        UPDATE:
        "The problem solves as":http://www.rsdn.ru/forum/cpp.qt/5465411.1
        But, I'm not sure that is the good solution.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          INCLUDEPATH is added to by the code in qt.prf . By the time qmake writes the Makefile all the -I paths are present. You cannot access this version directly but you can build the equivalent value... in exactly same sort of fashion as your "solution"

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Run "qmake -query". That will dump all the information it has on the Qt it came with, including all kinds of directories containing binaries/headers/examples and whatnot.

            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