Using qmake variables
Is there a way to get qmake 开发者_Python百科to substitute a custom variable like this? In other words, I want $(LIBS) to be replaced with the variable LIBS, so that I can easily change the include path from machine to machine. Many thanks in advance!
LIBS = c:/tmp/libs.pfo
INCLUDEPATH += . \
$(LIBS)/OpenCV2.1-msvc/include \
$(LIBS)/OpenCV2.1-msvc/modules/core/include \
$(LIBS)/OpenCV2.1-msvc/modules/imgproc/include \
...
I have also tried this to no avail:
LIBS = c:/tmp/libs.pfo
INCLUDEPATH += . \
$$quote($$LIBS/OpenCV2.1-msvc/include) \
$$quote($$LIBS/OpenCV2.1-msvc/modules/core/include) \
$$quote($$LIBS/OpenCV2.1-msvc/modules/imgproc/include) \
...
UPDATE: After seeing another thread I tried a third trick, which worked! qmake can't evaluate a proper variable
LIBS = c:/tmp/libs.pfo
INCLUDEPATH += . \
$$quote($${LIBS}/OpenCV2.1-msvc/include) \
$$quote($${LIBS}/OpenCV2.1-msvc/modules/core/include) \
$$quote($${LIBS}/OpenCV2.1-msvc/modules/imgproc/include) \
...
精彩评论