Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Building your wasm app with a custom HTML page
Forum Updated to NodeBB v4.3 + New Features

Building your wasm app with a custom HTML page

Scheduled Pinned Locked Moved Solved Qt for WebAssembly
3 Posts 2 Posters 957 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Adam C
    wrote on last edited by
    #1

    Hi,
    I'm building a Qt + OpenGL + Webassembly app using CMake and Qt Creator. All builds and runs fine.

    However, now I want to change the HTML, that is generated along with the wasm file. I put the html file into site/index.html. I can now enable the install step and install everything into a folder, that is served by apache like that:

        set(MY_INSTALL_FILES
            "$<TARGET_FILE_DIR:plain_renderer>/plain_renderer.js"
            "$<TARGET_FILE_DIR:plain_renderer>/plain_renderer.wasm"
            "$<TARGET_FILE_DIR:plain_renderer>/qtloader.js"
            "${CMAKE_SOURCE_DIR}/site/index.html"
            "${CMAKE_SOURCE_DIR}/site/mascot.png"
        )
        if (MY_ENABLE_THREADING)
            list(APPEND MY_INSTALL_FILES "$<TARGET_FILE_DIR:plain_renderer>/plain_renderer.worker.js")
        endif()
        install(FILES ${MY_INSTALL_FILES} DESTINATION ${MY_INSTALL_DIR})
    

    however, when i simply click on the run button in creator, the default html, which is generated automatically, is put into the build directory and started. that obviously doesn't include my changes.

    I can copy my own files into the build dir by

        configure_file(site/index.html index.html COPYONLY)
        configure_file(site/mascot.png mascot.png COPYONLY)
    

    but the run button still starts plain_renderer.html. I can see that in Projects -> WebAssembly -> Run -> Effective emrun call. I tried to change it to index.html, but it is always overwritten, and doesn't take effect.

    Is that a bug? Is there a canonical way to build with your own html files?

    1 Reply Last reply
    0
    • lorn.potterL Offline
      lorn.potterL Offline
      lorn.potter
      wrote on last edited by
      #2

      This is a known issue, please follow progress on this:
      https://bugreports.qt.io/browse/QTBUG-109959

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Adam C
        wrote on last edited by
        #3

        ok. cool. thanks :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved