使用qmake变量

时间:2011-03-04 21:32:09

标签: variables qmake

有没有办法让qmake替换像这样的自定义变量?换句话说,我希望用变量LIBS替换$(LIBS),这样我就可以轻松地改变从一台机器到另一台机器的包含路径。非常感谢提前!

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 \
...

我也试过这个无济于事:

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) \
...

1 个答案:

答案 0 :(得分:4)

更新:看到另一个帖子后,我尝试了第三个技巧,哪个有效! 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) \
...