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)
文章来源地址https://www.toymoban.com/news/detail-795696.html
文章来源:https://www.toymoban.com/news/detail-795696.html
到了这里,关于Qt的pro文件demo的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!