QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
#定义生成调试文件
CONFIG += debug
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
#设置输出目标的目录
isEmpty(PRO_BIN_PATH)
{
PRO_BIN_PATH = $${OUT_PWD}/bin
}
DESTDIR = $$PRO_BIN_PATH
#设置生成的pdb文件的保存目录
QMAKE_PDB = $$PRO_BIN_PATH/tsDemo.pdb
unix:!macx|win32: LIBS += -L$$PWD/JCLIB/lib/ -lJcSmartDevice2.0
unix:!macx|win32: LIBS += -L$$PWD/JCLIB/lib/ -lopencv_world411
#指定包含到编译器搜索头文件的路径
INCLUDEPATH += $$PWD/JCLIB/include
#设置生成Makefile过程中搜索依赖关系文件的路径
DEPENDPATH += $$PWD/JCLIB/include
# 区别:INCLUDEPATH用于指定编译器搜索头文件的路径,而DEPENDPATH用于指定生成Makefile过程中搜索依赖关系文件的路径
#拷贝对应的依赖文件到目标目录 (编译前拷贝)
QMAKE_PRE_LINK += $$QMAKE_COPY_DIR $$shell_path($$PWD/JCLIB\\lib\\*.lib) $$shell_path($$PRO_BIN_PATH/*.lib)
QMAKE_PRE_LINK += & $$QMAKE_COPY_DIR $$shell_path($$PWD/JCLIB\\dll\\*.dll) $$shell_path($$PRO_BIN_PATH/*.dll)
Qt的pro文件demo
最新推荐文章于 2024-08-24 23:04:51 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)