summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6WasmMacros.cmake
blob: e9c19160a378ca08af6f16913ef5991f37c15878 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

function(qt6_wasm_add_target_helpers target)
    # copy in Qt HTML/JS launch files for apps
    get_target_property(targetType "${target}" TYPE)
    if("${targetType}" STREQUAL "EXECUTABLE")

        set(APPNAME ${target})

        if(QT6_INSTALL_PREFIX)
            set(WASM_BUILD_DIR "${QT6_INSTALL_PREFIX}")
        elseif(QT_BUILD_DIR)
            set(WASM_BUILD_DIR "${QT_BUILD_DIR}")
        endif()

        configure_file("${WASM_BUILD_DIR}/plugins/platforms/wasm_shell.html"
            "${target}.html")
        configure_file("${WASM_BUILD_DIR}/plugins/platforms/qtloader.js"
            qtloader.js COPYONLY)
        configure_file("${WASM_BUILD_DIR}/plugins/platforms/qtlogo.svg"
            qtlogo.svg COPYONLY)

    endif()
endfunction()

if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
    function(qt_wasm_add_target_helpers)
        if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
            qt6_wasm_add_target_helpers(${ARGV})
        endif()
    endfunction()
endif()