美文网首页
Write a Qt pro file (1)

Write a Qt pro file (1)

作者: Feel君 | 来源:发表于2016-04-10 13:45 被阅读215次

    Part 1:

    QT += qml quick widgets
    
    TEMPLATE = app
    
    # Use Precompiled headers (PCH)
    PRECOMPILED_HEADER = Global.h
    
    # HEDDERS FILES
    HEADERS += version.h Global.h
    
    # SOURCE FILES
    SOURCES += main.cpp
    
    # UI FILES
    FORMS +=
    
    # RC FILES
    RC_FILE += resource.rc
    
    DISTFILES +=
    
    # include pri
    include(core/core.pri)
    
    

    Part 2:

    
    # COMMON -------------------------------------------------------------------------------------------
    #
    # 作用
    #
    # a. 生成一般程序结构: 程序路径为app目录.
    # b. qml文件,js文件,以及图片格式文件(jpg\gif\png\svg)自动添加到qrc文件内.
    # c. 可控制是否将以上自动文件生成的qrc文件编译链接到目标文件中.
    
    TARGET = $$qtLibraryTarget($$TARGET)
    
    # 自定义程序结构
    OUT_PWD = $$PWD/../../app
    TEMP_DIR = $$PWD/tmp
    
    DESTDIR = $$OUT_PWD/bin
    MOC_DIR += $$TEMP_DIR/moc
    UI_DIR += $$TEMP_DIR/ui
    
    # 编译选项
    DEFINES +=
    
    CONFIG+=debug_and_release
    CONFIG(debug, debug|release) {
    # TARGET = $${TARGET}d
     OBJECTS_DIR += $$TEMP_DIR/debug/obj
    
     DEFINES += _DEBUG
     LIBS += -L$${DESTDIR} -lmetalibd
    
    } else {
    # TARGET = $${TARGET}
     OBJECTS_DIR += $$TEMP_DIR/release/obj
    
     LIBS += -L$${DESTDIR} -lmetalib
    }
    
    # \end COMMON -------------------------------------------------------------------------------------------
    

    相关文章

      网友评论

          本文标题:Write a Qt pro file (1)

          本文链接:https://www.haomeiwen.com/subject/frbblttx.html