Does a Qt 5 programmer have to know about DEPENDPATH qmake variable?

后端 未结 1 1952
暖寄归人
暖寄归人 2021-02-08 08:34

With Qt 4 you are bound to get in trouble if you do not setup the variable correctly.

1条回答
  •  灰色年华
    2021-02-08 08:43

    If you program with Qt 5 you can safely forget that DEPENDPATH variable exists. All included files will generate dependencies for files in which they are included regardless of directories they reside.

    You don't have to put up with the variable in Qt 4 too. Just add this to your .pro file:

    CONFIG += depend_includepath
    

    If you want to use DEPENDPATH variable for some reasons with Qt 5 you can switch the option off:

    CONFIG -= depend_includepath
    

    But be aware that DEPENDPATH variable behavior was changed in Qt 5 so even with the option turned off you won't get exact Qt 4 emulation.

    Bottom line: forget about DEPENDPATH and don't use it.

    If you can read Russian there is more info here.

    0 讨论(0)
提交回复
热议问题