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

偶尔善良 提交于 2019-12-13 11:43:09

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/16769541/does-a-qt-5-programmer-have-to-know-about-dependpath-qmake-variable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!