zoukankan      html  css  js  c++  java
  • Qt Qml Application Deploy (部署Qt程序以便发布到平台上执行)

    QMake: (Add this in .pro)

    isEmpty(TARGET_EXT) {
        win32 {
            TARGET_CUSTOM_EXT = .exe
        }
        macx {
            TARGET_CUSTOM_EXT = .app
        }
    } else {
        TARGET_CUSTOM_EXT = $${TARGET_EXT}
    }
    
    DEPLOY_COMMAND = $$(QTDIR)/bin/windeployqt
    
    CONFIG( debug, debug|release ) {
        # debug
        DEPLOY_TARGET = $$shell_quote($$shell_path($${OUT_PWD}/debug/$${TARGET}$${TARGET_CUSTOM_EXT}))
    } else {
        # release
        DEPLOY_TARGET = $$shell_quote($$shell_path($${OUT_PWD}/release/$${TARGET}$${TARGET_CUSTOM_EXT}))
    }
    
    QMAKE_POST_LINK = $${DEPLOY_COMMAND} $${DEPLOY_TARGET} 
        --qmldir $${PWD} 
        --no-translations 
        --no-system-d3d-compiler 
        --no-webkit2 
        --no-angle 
        --no-opengl-sw 
        --no-virtualkeyboard
    message($${QMAKE_POST_LINK})
    

    CMake:

    string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
    get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
    get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
    find_program(DEPLOYQT_EXECUTABLE NAMES windeployqt HINTS "${_qt_bin_dir}")
    add_custom_command(TARGET PROJECT_NAME
            POST_BUILD
            COMMAND ${DEPLOYQT_EXECUTABLE} "$<TARGET_FILE:PROJECT_NAME>"
            --force
            --${CMAKE_BUILD_TYPE_LOWER}
            --qmldir ${CMAKE_SOURCE_DIR}/qml
            --no-translations
            --no-system-d3d-compiler
            --no-webkit2
            --no-angle
            --no-opengl-sw
            --no-virtualkeyboard
        )
    
  • 相关阅读:
    Three.js 类的粗略总结和实现
    JavaScript方法
    JavaScript 继承和数组
    JavaScript 函数
    操作系统之堆和栈的区别
    第十二章 动态内存
    第十三章-第六小节-对象移动
    第十五章 面形对象程序设计
    动态建树和静态建树
    高斯消元整数版和浮点数版实现
  • 原文地址:https://www.cnblogs.com/yinsua/p/15060846.html
Copyright © 2011-2022 走看看