From 2a2f04205ccedf83b32cd91f08f40972e5430468 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Mon, 20 May 2019 10:28:12 +0200 Subject: WASM: Make wasm_shell.html compatible with CMake configure_file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CMake configure_file command is commonly used copy & modify template files during the build process. One limitation, thought, is that configure_file expect the variables to be replaced to be encoded using either a @APPNAME@ or ${APPNAME} convention. This commit therefore changes "APPNAME" to "@APPNAME@" in wasm_shell.html to make the HTML template file compatible with CMake configure_file. With this commit, it becomes possible to write the following CMake function that mimics what QMake is already doing: function(copy_html_js_launch_files target) set(APPNAME ${target}) configure_file("${_qt5Core_install_prefix}/plugins/platforms/wasm_shell.html" "${target}.html") configure_file("${_qt5Core_install_prefix}/plugins/platforms/qtloader.js" qtloader.js COPYONLY) endfunction() Change-Id: Ic38abdc498ba03b8d21f1b9b70aa1d480ae7f362 Reference: https://cmake.org/cmake/help/latest/command/configure_file.html Reviewed-by: Morten Johan Sørvig --- mkspecs/features/wasm/wasm.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs/features/wasm/wasm.prf') diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf index de726c674c..54d351bfd5 100644 --- a/mkspecs/features/wasm/wasm.prf +++ b/mkspecs/features/wasm/wasm.prf @@ -67,7 +67,7 @@ contains(TEMPLATE, .*app) { # replacing the app name placeholder with the actual app name. apphtml.name = application main html file apphtml.output = $$DESTDIR/$$TARGET_HTML - apphtml.commands = sed -e s/APPNAME/$$TARGET_BASE/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML + apphtml.commands = sed -e s/@APPNAME@/$$TARGET_BASE/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML apphtml.input = $$WASM_PLUGIN_PATH/wasm_shell.html apphtml.depends = $$apphtml.input QMAKE_EXTRA_COMPILERS += apphtml -- cgit v1.2.3