QT .pro file: How to change default include path for MAC frameworks

跟風遠走 提交于 2019-12-11 23:29:20

问题


My .pro file looks like this:

QT += core gui widgets 

SOURCES += a.cpp    
HEADERS  += a.h
FORMS   += a.ui

#Locally compiled Qt framework. Qt/out/{QtCore.framework,QtNetwork.framework..}
QMAKE_LFLAGS += -L./Qt/lib/
QMAKE_CXXFLAGS += -F./Qt/lib/


macx {
    QMAKE_MAC_SDK   = macosx10.9
    LIBS            += -framework QtCore -framework QtNetwork -framework QtGui -framework QtWidgets
}

I want to use frameworks compiled locally, but QT5.5 automatically includes framework from QT5.5.0 install directory ... I see a.cpp compiling with following include switch:

 -I/Users/banana/Qt5.5.0/5.5/clang_64/lib/QtWidgets.framework/Headers

I tried resetting INCLUDEPATH = in .pro file in hopes that it resets the default include path and added proper INCLUDEPATH += ./Qt/lib but it doesn't work.

Using MAC, OS X 10.10.2


回答1:


The Qt installation that gets used will be determined by which qmake you run. If you have multiple versions of Qt installed (e.g. one you built from sources yourself and one provided by the system or by a Qt Creator install), you need to ensure you are running the qmake from the Qt you want to use. You should be able to verify this from the command line fairly easily. If you are using an IDE like Qt Creator and are having issues getting the right Qt selected, try building from a command line first to verify that you can get the right Qt that way as a first step. If building things from the command line where you have absolute control over which qmake is used still doesn't work, then this would suggest the qmake you are trying to use isn't behaving in the expected way.



来源:https://stackoverflow.com/questions/33578619/qt-pro-file-how-to-change-default-include-path-for-mac-frameworks

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