How to get path to QT includes?



  • 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.



  • @
    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)



  • 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.



  • 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"


  • Moderators

    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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.