Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 4 Support (Qt 6) › CMake publish or test enhancement?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #25238

    Bas

    hi I have found some sort automation of publish and test version control from CmakeList.txt

    i just wanted to share this

    in the CMakeList.txt i check for PRODUCT_STAGE is equal to “publish”

    # Add QML files and resources to QML module to included them via QRC automatically:
    if(PRODUCT_STAGE STREQUAL "publish")
    
    qt_add_qml_module(
    GCDriene URI
    GCDriene VERSION 1.0
    # uncomment for publishing:
    QML_FILES ${QmlFiles}
    RESOURCES ${AssetsFiles}
    NO_RESOURCE_TARGET_PATH
    )
    
    add_definitions(-DAPP_BUILD_TYPE_PUBLSH)
    
    else()
    
    qt_add_qml_module(
    GCDriene URI
    GCDriene VERSION 1.0
    # uncomment for publishing:
    # QML_FILES ${QmlFiles}
    # RESOURCES ${AssetsFiles}
    NO_RESOURCE_TARGET_PATH
    )
    
    add_definitions(-DAPP_BUILD_TYPE_TEST)
    
    endif(USE_PUBLISH_BUILD_ONOFF)

     

    then in main.cpp i have made some simple adjustments

        // use this during development
        // for PUBLISHING, use the entry point below
    #ifdef APP_BUILD_TYPE_TEST
        felgo.setMainQmlFileName(QStringLiteral("qml/Main.qml"));
    #endif
        // use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc
        // this is the preferred deployment option for publishing games to the app stores, because then your qml files and js files are protected
        // to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file
        // also see the .pro file for more details
    #ifdef APP_BUILD_TYPE_PUBLSH
        felgo.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
    #endif
    
    
    

     

Viewing 1 post (of 1 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded