Skip to content

Commit

Permalink
generate gui from dedicated .html file
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-hro committed Nov 9, 2024
1 parent d180f05 commit ab983cb
Show file tree
Hide file tree
Showing 4 changed files with 415 additions and 3 deletions.
8 changes: 8 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
message(STATUS "Generate gui-html.hpp using gui.html content")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gui.html)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/gui.html" GUI_HTML_CONTENT)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/gui-html.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/gui-html.hpp"
)

set(LIBS_FOR_EXAMPLES
${LIBUSOCKETS_STATIC}
nlohmann_json::nlohmann_json
Expand Down
7 changes: 4 additions & 3 deletions examples/gui-html.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-FileCopyrightText: 2023-present Benno Waldhauer
// SPDX-License-Identifier: MIT

// This is a CMake generated file. DO NOT EDIT.

#pragma once

constexpr char gui_html[] = R"""(
<!doctype html>
constexpr char gui_html[] = R"""(<!doctype html>
<html lang="en">
<head>
<title>Slot Machine GUI</title>
Expand Down Expand Up @@ -399,4 +400,4 @@ constexpr char gui_html[] = R"""(
</div>
</body>
</html>
)""";
)""";
9 changes: 9 additions & 0 deletions examples/gui-html.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Webthing-CPP
// SPDX-FileCopyrightText: 2023-present Benno Waldhauer
// SPDX-License-Identifier: MIT

// This is a CMake generated file. DO NOT EDIT.

#pragma once

constexpr char gui_html[] = R"""(@GUI_HTML_CONTENT@)""";
Loading

0 comments on commit ab983cb

Please sign in to comment.