[SOLVED] Qmake INCLUDEPATH does Not includes sub folders?


  • Qt Champions 2016

    Update:
    Reading
    http://www.mingw.org/wiki/includepathhowto
    Its seems that adding all folder is by design (or lack of) and the
    smart flag /folder/** is not supported.
    Also I could use #include "../path/sub path/file.h" but
    its less optimal if you refactor folder structure sometimes.

    Hi
    Trying to get my trace system up and running in Qt.
    it has a folder structure like
    ..\Common\Platform
    Exception
    FileStream
    IpNet
    MultiOS
    String
    Trace
    Types

    Normally I would just add "Platform" to include path (for my current compiler) and any file under
    would be found.

    Seems QMake wants all listed
    like
    INCLUDEPATH += $$PWD/../AllPO/Source/Common/Platform/Trace
    $$PWD/../AllPO/Source/Common/Platform/Types
    ...

    Which is kinda a nightmare as there are sub and sub-sub folders too.

    So am I doing it wrong ?



  • We can guess Windows but have no idea what compilers are involved. I am not aware of any compiler that treats include path options recursively.

    Take a look at the actual compiler command generated by qmake and make sure that $PWD is expanding to the place you think it is.


  • Qt Champions 2016

    @ChrisW67
    Sorry, forgot to mention platform. (facepalm)
    win 7, mingw

    Yes I did use $PWD and added each folder.
    Just wanted an easier way, but that not possible.

    C++ builder looks in sub folder for includes pr default/pr option.

    I assume $PWD is always where the .pro file is.

    Thank you


Log in to reply
 

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