QT Creator的pro文件解析(qmake说明)

/ 0评 / 0

1.修改pro文件后,需要执行qmake,qmake只更新当前编译模式(debug或release)下的makefile

qmake:运行qmake,生成适当的makefile-->根据pro文件更新makefile文件
build(构建):增量编译,只编译有变化的部分-->make
run(运行):有改动则根据已有的makefile进行编译,并且运行-->./a.out

运行顺序是:qmake->build->run

2.pro文件配置

3.示例

TEMPLATE = app

CONFIG += console c++11 debug_and_release build_all
CONFIG -= app_bundle
CONFIG -= qt

CONFIG(debug, debug|release){
    TARGET = test_ffmpegd
    DESTDIR = $$PWD/Debug
} else {
    TARGET = test_ffmpeg
    DESTDIR = $$PWD/Release
}

OBJECTS_DIR = $$PWD/obj

SOURCES += main.cpp

win32{
    contains(QT_ARCH, i386) {
        message("32-bit")
        INCLUDEPATH += $$PWD/lib/ffmpeg/include
        LIBS += -L$$PWD/lib/ffmpeg/lib -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc -lswresample -lswscale
    } else {
        message("64-bit")
    }
}
unix{

}

4.参考链接

https://www.cnblogs.com/Braveliu/p/5107550.html