windowpp 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/bin/windowpp.js +86 -0
  2. package/cmake/embed_assets.py +144 -0
  3. package/framework/CMakeLists.txt +176 -0
  4. package/framework/include/windowpp/windowpp.h +704 -0
  5. package/framework/src/AppData/API/AppData.ts +137 -0
  6. package/framework/src/AppData/appdata_bridge.h +138 -0
  7. package/framework/src/AppData/appdata_manager.cpp +126 -0
  8. package/framework/src/AppData/appdata_manager.h +3 -0
  9. package/framework/src/FileSystem/API/FileSystem.ts +389 -0
  10. package/framework/src/FileSystem/Linux/filesearch.cpp +148 -0
  11. package/framework/src/FileSystem/Linux/readfile.cpp +79 -0
  12. package/framework/src/FileSystem/Linux/savefile.cpp +333 -0
  13. package/framework/src/FileSystem/MacOS/filesearch.cpp +149 -0
  14. package/framework/src/FileSystem/MacOS/readfile.cpp +80 -0
  15. package/framework/src/FileSystem/MacOS/savefile.cpp +264 -0
  16. package/framework/src/FileSystem/Windows/filesearch.cpp +195 -0
  17. package/framework/src/FileSystem/Windows/readfile.cpp +122 -0
  18. package/framework/src/FileSystem/Windows/savefile.cpp +290 -0
  19. package/framework/src/FileSystem/file_index_service.cpp +262 -0
  20. package/framework/src/FileSystem/file_index_service.h +55 -0
  21. package/framework/src/FileSystem/filesystem_bridge.h +243 -0
  22. package/framework/src/FileSystem/filesystem_handler.h +93 -0
  23. package/framework/src/FileSystem/filesystem_json.h +241 -0
  24. package/framework/src/FileSystem/filesystem_search_service.cpp +414 -0
  25. package/framework/src/FileSystem/filesystem_search_service.h +94 -0
  26. package/framework/src/Input/API/Input.ts +161 -0
  27. package/framework/src/Input/Linux/linux_key_utils.h +135 -0
  28. package/framework/src/Input/MacOS/macos_key_utils.h +137 -0
  29. package/framework/src/Input/Windows/win32_key_utils.h +199 -0
  30. package/framework/src/Input/input_bridge.h +192 -0
  31. package/framework/src/Input/input_service.cpp +584 -0
  32. package/framework/src/Input/input_service.h +21 -0
  33. package/framework/src/application.cpp +29 -0
  34. package/framework/src/common/hit_test.cpp +40 -0
  35. package/framework/src/common/image_loader.cpp +24 -0
  36. package/framework/src/common/paths.cpp +75 -0
  37. package/framework/src/filedrop/filedrop.cpp +316 -0
  38. package/framework/src/filedrop/filedrop.css +421 -0
  39. package/framework/src/filedrop/filedrop.hpp +92 -0
  40. package/framework/src/filedrop/filedrop.ts +183 -0
  41. package/framework/src/platform/API/App.ts +156 -0
  42. package/framework/src/platform/API/Window.ts +249 -0
  43. package/framework/src/platform/linux/app_linux.cpp +256 -0
  44. package/framework/src/platform/linux/app_linux.h +64 -0
  45. package/framework/src/platform/linux/linux_helpers.cpp +26 -0
  46. package/framework/src/platform/linux/linux_helpers.h +19 -0
  47. package/framework/src/platform/linux/tray_linux.cpp +21 -0
  48. package/framework/src/platform/linux/tray_linux.h +26 -0
  49. package/framework/src/platform/linux/window_linux.cpp +256 -0
  50. package/framework/src/platform/linux/window_linux.h +70 -0
  51. package/framework/src/platform/macos/app_macos.h +59 -0
  52. package/framework/src/platform/macos/app_macos.mm +223 -0
  53. package/framework/src/platform/macos/macos_helpers.h +21 -0
  54. package/framework/src/platform/macos/tray_macos.h +22 -0
  55. package/framework/src/platform/macos/tray_macos.mm +53 -0
  56. package/framework/src/platform/macos/window_macos.h +74 -0
  57. package/framework/src/platform/macos/window_macos.mm +318 -0
  58. package/framework/src/platform/platform_bridge.h +514 -0
  59. package/framework/src/platform/platform_factory.cpp +33 -0
  60. package/framework/src/platform/platform_factory.h +19 -0
  61. package/framework/src/platform/win32/app_win32.cpp +572 -0
  62. package/framework/src/platform/win32/app_win32.h +83 -0
  63. package/framework/src/platform/win32/tray_win32.cpp +57 -0
  64. package/framework/src/platform/win32/tray_win32.h +30 -0
  65. package/framework/src/platform/win32/win32_helpers.h +61 -0
  66. package/framework/src/platform/win32/window_win32.cpp +267 -0
  67. package/framework/src/platform/win32/window_win32.h +79 -0
  68. package/framework/src/renderer/webgpu.h +128 -0
  69. package/framework/src/renderer/webview/include/WebView2.h +48014 -0
  70. package/framework/src/renderer/webview/include/WebView2EnvironmentOptions.h +342 -0
  71. package/framework/src/renderer/webview/webview.h +13 -0
  72. package/framework/src/renderer/webview/webview_linux.cpp +392 -0
  73. package/framework/src/renderer/webview/webview_macos.mm +388 -0
  74. package/framework/src/renderer/webview/webview_win32.cpp +688 -0
  75. package/framework/src/renderer/webview/x64/WebView2Loader.dll +0 -0
  76. package/framework/src/renderer/webview/x64/WebView2Loader.lib +0 -0
  77. package/framework/src/renderer/webview/x64/WebView2LoaderStatic.lib +0 -0
  78. package/lib/build.js +112 -0
  79. package/lib/create.js +283 -0
  80. package/lib/dev.js +155 -0
  81. package/package.json +24 -0
  82. package/scripts/publish.js +67 -0
  83. package/scripts/sync-framework.js +73 -0
  84. package/templates/solid/CMakeLists.txt +56 -0
  85. package/templates/solid/frontend/package.json +22 -0
  86. package/templates/solid/frontend/vite.config.ts +25 -0
  87. package/templates/solid/main.cpp +72 -0
  88. package/templates/solid/package.json +12 -0
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ // cli/bin/windowpp.js — WindowPP CLI entry point
3
+ //
4
+ // Global install: npm install -g windowpp
5
+ // Usage:
6
+ // windowpp create <name> [--template solid] [--out-dir .]
7
+ // windowpp build [--clean] [--app-dir .] [--config Release|Debug]
8
+ // windowpp dev [--clean] [--app-dir .] [--port 3000]
9
+
10
+ 'use strict';
11
+
12
+ const path = require('path');
13
+
14
+ const args = process.argv.slice(2);
15
+ const command = args[0];
16
+
17
+ function parseFlags(args) {
18
+ const flags = {};
19
+ for (let i = 0; i < args.length; i++) {
20
+ const a = args[i];
21
+ if (a === '--clean') flags.clean = true;
22
+ else if (a === '--app-dir' && args[i + 1]) { flags.appDir = path.resolve(args[++i]); }
23
+ else if (a === '--out-dir' && args[i + 1]) { flags.outDir = path.resolve(args[++i]); }
24
+ else if (a === '--template' && args[i + 1]) { flags.template = args[++i]; }
25
+ else if (a === '--config' && args[i + 1]) { flags.config = args[++i]; }
26
+ else if (a === '--port' && args[i + 1]) { flags.port = parseInt(args[++i], 10); }
27
+ }
28
+ return flags;
29
+ }
30
+
31
+ switch (command) {
32
+ case 'build': {
33
+ const flags = parseFlags(args.slice(1));
34
+ const { build } = require('../lib/build');
35
+ build({ appDir: flags.appDir, clean: flags.clean, config: flags.config });
36
+ break;
37
+ }
38
+
39
+ case 'dev': {
40
+ const flags = parseFlags(args.slice(1));
41
+ const { dev } = require('../lib/dev');
42
+ dev({ appDir: flags.appDir, clean: flags.clean, port: flags.port });
43
+ break;
44
+ }
45
+
46
+ case 'create': {
47
+ const name = args[1];
48
+ if (!name || name.startsWith('--')) {
49
+ console.error('Usage: windowpp create <app-name> [--template solid] [--out-dir .]');
50
+ process.exit(1);
51
+ }
52
+ const flags = parseFlags(args.slice(2));
53
+ const { create } = require('../lib/create');
54
+ create(name, { template: flags.template, outDir: flags.outDir });
55
+ break;
56
+ }
57
+
58
+ case '--version':
59
+ case '-v': {
60
+ const pkg = require('../package.json');
61
+ console.log(`windowpp v${pkg.version}`);
62
+ break;
63
+ }
64
+
65
+ default: {
66
+ console.log(`
67
+ windowpp — WindowPP CLI
68
+
69
+ Usage:
70
+ windowpp create <app-name> Scaffold a new WindowPP app
71
+ windowpp dev Start dev mode (Vite + native binary)
72
+ windowpp build Build for production
73
+
74
+ Options:
75
+ --app-dir <path> App directory (default: cwd)
76
+ --out-dir <path> Output directory for 'create' (default: cwd)
77
+ --template <name> Template name for 'create' (default: solid)
78
+ --config <cfg> CMake config for 'build', e.g. Release|Debug (default: Release)
79
+ --port <n> Vite dev server port (default: auto-detect or 3000)
80
+ --clean Clean build outputs before building
81
+ -v, --version Print version
82
+ `);
83
+ if (command && command !== '--help' && command !== '-h') process.exit(1);
84
+ break;
85
+ }
86
+ }
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env python3
2
+ """embed_assets.py — Embed a directory of files as C++ byte arrays.
3
+
4
+ Usage: embed_assets.py <dist_dir> <output_cpp> <output_h>
5
+
6
+ Walks <dist_dir> recursively, reads each file as binary, and emits:
7
+ - <output_cpp> with one `static const uint8_t asset_N[]` per file plus
8
+ a `kAssets[]` table and `find_asset` / `mime_for_path` helpers.
9
+ - <output_h> declaring the EmbeddedAsset struct and both helpers.
10
+ """
11
+
12
+ import os
13
+ import sys
14
+
15
+ MIME_MAP = {
16
+ '.html': 'text/html; charset=utf-8',
17
+ '.js': 'application/javascript',
18
+ '.mjs': 'application/javascript',
19
+ '.cjs': 'application/javascript',
20
+ '.css': 'text/css',
21
+ '.json': 'application/json',
22
+ '.map': 'application/json',
23
+ '.png': 'image/png',
24
+ '.jpg': 'image/jpeg',
25
+ '.jpeg': 'image/jpeg',
26
+ '.gif': 'image/gif',
27
+ '.svg': 'image/svg+xml',
28
+ '.ico': 'image/x-icon',
29
+ '.webp': 'image/webp',
30
+ '.woff': 'font/woff',
31
+ '.woff2': 'font/woff2',
32
+ '.ttf': 'font/ttf',
33
+ '.otf': 'font/otf',
34
+ '.txt': 'text/plain',
35
+ '.xml': 'application/xml',
36
+ }
37
+
38
+
39
+ def mime_for(filename):
40
+ ext = os.path.splitext(filename)[1].lower()
41
+ return MIME_MAP.get(ext, 'application/octet-stream')
42
+
43
+
44
+ def to_c_ident(rel_path):
45
+ """Turn a relative path into a valid C identifier."""
46
+ return 'wpp_asset_' + ''.join(
47
+ c if c.isalnum() else '_' for c in rel_path
48
+ ).strip('_')
49
+
50
+
51
+ def escape_c_string(s):
52
+ return s.replace('\\', '\\\\').replace('"', '\\"')
53
+
54
+
55
+ def main():
56
+ if len(sys.argv) != 4:
57
+ print(f'Usage: {sys.argv[0]} <dist_dir> <output_cpp> <output_h>',
58
+ file=sys.stderr)
59
+ sys.exit(1)
60
+
61
+ dist_dir = sys.argv[1]
62
+ out_cpp = sys.argv[2]
63
+ out_h = sys.argv[3]
64
+
65
+ if not os.path.isdir(dist_dir):
66
+ print(f'embed_assets.py: dist_dir not found: {dist_dir}', file=sys.stderr)
67
+ sys.exit(1)
68
+
69
+ # Collect assets: (web_path, c_ident, mime, bytes)
70
+ assets = []
71
+ for root, dirs, files in os.walk(dist_dir):
72
+ dirs.sort()
73
+ for fname in sorted(files):
74
+ full = os.path.join(root, fname)
75
+ rel = os.path.relpath(full, dist_dir).replace('\\', '/')
76
+ web = '/' + rel
77
+ ident = to_c_ident(rel)
78
+ mime = mime_for(fname)
79
+ with open(full, 'rb') as f:
80
+ data = f.read()
81
+ assets.append((web, ident, mime, data))
82
+
83
+ os.makedirs(os.path.dirname(out_h), exist_ok=True)
84
+ os.makedirs(os.path.dirname(out_cpp), exist_ok=True)
85
+
86
+ # ── Write header ──────────────────────────────────────────────────────────
87
+ with open(out_h, 'w', newline='\n') as h:
88
+ h.write("""\
89
+ #pragma once
90
+ // Auto-generated by cmake/embed_assets.py — do not edit manually.
91
+
92
+ #include <cstddef>
93
+ #include <cstdint>
94
+ #include <string>
95
+
96
+ struct EmbeddedAsset {
97
+ const char* path; // e.g. "/index.html"
98
+ const uint8_t* data;
99
+ std::size_t size;
100
+ const char* content_type; // e.g. "text/html; charset=utf-8"
101
+ };
102
+
103
+ // Returns the asset for the given URL path, or nullptr if not found.
104
+ const EmbeddedAsset* find_asset(const std::string& path);
105
+ """)
106
+
107
+ # ── Write implementation ───────────────────────────────────────────────────
108
+ with open(out_cpp, 'w', newline='\n') as c:
109
+ c.write('// Auto-generated by cmake/embed_assets.py — do not edit manually.\n')
110
+ c.write('#include "embedded_assets.h"\n\n')
111
+
112
+ for web, ident, mime, data in assets:
113
+ c.write(f'// {web}\n')
114
+ c.write(f'static const uint8_t {ident}[] = {{\n')
115
+ for i, byte in enumerate(data):
116
+ if i % 16 == 0:
117
+ c.write(' ')
118
+ c.write(f'0x{byte:02x},')
119
+ if i % 16 == 15:
120
+ c.write('\n')
121
+ if len(data) % 16 != 0:
122
+ c.write('\n')
123
+ c.write('};\n\n')
124
+
125
+ c.write('static const EmbeddedAsset kAssets[] = {\n')
126
+ for web, ident, mime, data in assets:
127
+ c.write(f' {{ "{escape_c_string(web)}", {ident}, {len(data)}, "{escape_c_string(mime)}" }},\n')
128
+ c.write(' { nullptr, nullptr, 0, nullptr }\n')
129
+ c.write('};\n\n')
130
+
131
+ c.write("""\
132
+ const EmbeddedAsset* find_asset(const std::string& path) {
133
+ for (const EmbeddedAsset* a = kAssets; a->path != nullptr; ++a) {
134
+ if (path == a->path) return a;
135
+ }
136
+ return nullptr;
137
+ }
138
+ """)
139
+
140
+ print(f'embed_assets.py: embedded {len(assets)} file(s) -> {out_cpp}')
141
+
142
+
143
+ if __name__ == '__main__':
144
+ main()
@@ -0,0 +1,176 @@
1
+ cmake_minimum_required(VERSION 3.16)
2
+ project(windowpp VERSION 1.0.0 LANGUAGES CXX)
3
+
4
+ set(CMAKE_CXX_STANDARD 17)
5
+ find_package(Python3 REQUIRED COMPONENTS Interpreter)
6
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
+
8
+ find_package(nlohmann_json 3.11.3 CONFIG QUIET)
9
+ if(NOT nlohmann_json_FOUND)
10
+ include(FetchContent)
11
+ FetchContent_Declare(
12
+ nlohmann_json
13
+ URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
14
+ DOWNLOAD_EXTRACT_TIMESTAMP TRUE
15
+ )
16
+ FetchContent_MakeAvailable(nlohmann_json)
17
+ endif()
18
+
19
+ # ─── Library ──────────────────────────────────────────────────────────────────
20
+
21
+ add_library(windowpp STATIC
22
+ src/application.cpp
23
+ src/AppData/appdata_manager.cpp
24
+ src/common/hit_test.cpp
25
+ src/common/paths.cpp
26
+ src/FileSystem/file_index_service.cpp
27
+ src/FileSystem/filesystem_search_service.cpp
28
+ src/Input/input_service.cpp
29
+ )
30
+
31
+ target_link_libraries(windowpp PRIVATE $<BUILD_INTERFACE:nlohmann_json::nlohmann_json>)
32
+
33
+ target_include_directories(windowpp PUBLIC
34
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
35
+ $<INSTALL_INTERFACE:include>
36
+ )
37
+
38
+ # ─── Platform Sources & Dependencies ─────────────────────────────────────────
39
+
40
+ if(WIN32)
41
+ target_sources(windowpp PRIVATE
42
+ src/FileSystem/Windows/filesearch.cpp
43
+ src/FileSystem/Windows/readfile.cpp
44
+ src/FileSystem/Windows/savefile.cpp
45
+ src/platform/win32/app_win32.cpp
46
+ src/platform/win32/window_win32.cpp
47
+ src/platform/win32/tray_win32.cpp
48
+ src/platform/win32/win32_helpers.h
49
+ src/renderer/webview/webview.h
50
+ src/renderer/webview/webview_win32.cpp
51
+ )
52
+ target_link_libraries(windowpp PRIVATE
53
+ dwmapi user32 gdi32 shell32 ole32 comctl32 shlwapi
54
+ )
55
+ target_compile_definitions(windowpp PRIVATE
56
+ UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX
57
+ )
58
+ target_include_directories(windowpp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview)
59
+
60
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview/include")
61
+ set(WEBVIEW2_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview/include")
62
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview/x64/WebView2LoaderStatic.lib")
63
+ set(WEBVIEW2_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview/x64/WebView2LoaderStatic.lib")
64
+ set(WEBVIEW2_STATIC TRUE)
65
+ message(STATUS "Using local WebView2 SDK (static loader)")
66
+ else()
67
+ set(WEBVIEW2_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview/x64/WebView2Loader.lib")
68
+ message(STATUS "Using local WebView2 SDK (dynamic loader)")
69
+ endif()
70
+ endif()
71
+
72
+ if(NOT WEBVIEW2_INCLUDE_DIR AND DEFINED ENV{WINDOWS_SDK_ROOT})
73
+ find_path(WEBVIEW2_INCLUDE_DIR NAMES webview2.h PATHS "$ENV{WINDOWS_SDK_ROOT}/include" PATH_SUFFIXES um)
74
+ find_library(WEBVIEW2_LIBRARY NAMES WebView2Loader PATHS "$ENV{WINDOWS_SDK_ROOT}/lib" PATH_SUFFIXES um/${PLATFORM})
75
+ endif()
76
+ if(NOT WEBVIEW2_INCLUDE_DIR)
77
+ find_path(WEBVIEW2_INCLUDE_DIR NAMES webview2.h PATHS "C:/Program Files (x86)/Windows Kits/10/include" PATH_SUFFIXES um)
78
+ endif()
79
+ if(NOT WEBVIEW2_LIBRARY)
80
+ find_library(WEBVIEW2_LIBRARY NAMES WebView2Loader PATHS "C:/Program Files (x86)/Windows Kits/10/lib" PATH_SUFFIXES um/${PLATFORM})
81
+ endif()
82
+
83
+ if(WEBVIEW2_INCLUDE_DIR AND WEBVIEW2_LIBRARY)
84
+ target_compile_definitions(windowpp PRIVATE WPP_HAS_WEBVIEW2=1)
85
+ target_link_libraries(windowpp PRIVATE ${WEBVIEW2_LIBRARY})
86
+ if(WEBVIEW2_STATIC)
87
+ target_link_libraries(windowpp PRIVATE version)
88
+ endif()
89
+ target_include_directories(windowpp PRIVATE ${WEBVIEW2_INCLUDE_DIR})
90
+ message(STATUS "WebView2 enabled: ${WEBVIEW2_INCLUDE_DIR}")
91
+ else()
92
+ target_compile_definitions(windowpp PRIVATE WPP_HAS_WEBVIEW2=0)
93
+ message(WARNING "WebView2 headers/libraries not found. WebView is DISABLED.")
94
+ endif()
95
+
96
+ elseif(APPLE)
97
+ enable_language(OBJCXX)
98
+ target_sources(windowpp PRIVATE
99
+ src/FileSystem/MacOS/filesearch.cpp
100
+ src/FileSystem/MacOS/readfile.cpp
101
+ src/FileSystem/MacOS/savefile.cpp
102
+ src/platform/macos/app_macos.mm
103
+ src/platform/macos/window_macos.mm
104
+ src/platform/macos/tray_macos.mm
105
+ src/platform/macos/macos_helpers.h
106
+ src/renderer/webview/webview.h
107
+ src/renderer/webview/webview_macos.mm
108
+ )
109
+ target_link_libraries(windowpp PRIVATE
110
+ "-framework Cocoa"
111
+ "-framework AppKit"
112
+ "-framework Carbon"
113
+ "-framework QuartzCore"
114
+ "-framework WebKit"
115
+ )
116
+ target_include_directories(windowpp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview)
117
+
118
+ elseif(UNIX)
119
+ find_package(PkgConfig REQUIRED)
120
+ pkg_check_modules(XCB REQUIRED
121
+ xcb xcb-cursor xcb-randr xcb-icccm xcb-ewmh xcb-keysyms xcb-xfixes
122
+ )
123
+ pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.1)
124
+ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
125
+ pkg_check_modules(APPINDICATOR QUIET appindicator3-0.1)
126
+
127
+ target_sources(windowpp PRIVATE
128
+ src/FileSystem/Linux/filesearch.cpp
129
+ src/FileSystem/Linux/readfile.cpp
130
+ src/FileSystem/Linux/savefile.cpp
131
+ src/platform/linux/app_linux.cpp
132
+ src/platform/linux/window_linux.cpp
133
+ src/platform/linux/tray_linux.cpp
134
+ src/platform/linux/linux_helpers.cpp
135
+ src/renderer/webview/webview.h
136
+ src/renderer/webview/webview_linux.cpp
137
+ )
138
+ target_include_directories(windowpp PRIVATE
139
+ ${XCB_INCLUDE_DIRS}
140
+ ${WEBKIT2_INCLUDE_DIRS}
141
+ ${GTK3_INCLUDE_DIRS}
142
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/renderer/webview
143
+ )
144
+ target_link_libraries(windowpp PRIVATE
145
+ ${XCB_LIBRARIES}
146
+ ${WEBKIT2_LIBRARIES}
147
+ ${GTK3_LIBRARIES}
148
+ )
149
+
150
+ if(APPINDICATOR_FOUND)
151
+ target_compile_definitions(windowpp PRIVATE WPP_HAS_APPINDICATOR)
152
+ target_include_directories(windowpp PRIVATE ${APPINDICATOR_INCLUDE_DIRS})
153
+ target_link_libraries(windowpp PRIVATE ${APPINDICATOR_LIBRARIES})
154
+ endif()
155
+ endif()
156
+
157
+ # ─── Interface target for app exe linking ─────────────────────────────────────
158
+ # App executables link `windowpp_deps` to pull in platform-specific libs that
159
+ # can't be transitively propagated from a STATIC library (e.g. WebView2 on Win).
160
+ add_library(windowpp_deps INTERFACE)
161
+ if(WIN32 AND WEBVIEW2_LIBRARY)
162
+ target_include_directories(windowpp_deps INTERFACE ${WEBVIEW2_INCLUDE_DIR})
163
+ target_link_libraries(windowpp_deps INTERFACE ${WEBVIEW2_LIBRARY})
164
+ if(WEBVIEW2_STATIC)
165
+ target_link_libraries(windowpp_deps INTERFACE version)
166
+ endif()
167
+ endif()
168
+
169
+ # ─── WPP_EMBED_SCRIPT ─────────────────────────────────────────────────────────
170
+ # Injected by the windowpp CLI via -DWPP_EMBED_SCRIPT=...
171
+ # Fallback: embed_assets.py sits one level up from this CMakeLists in the package.
172
+ if(NOT DEFINED WPP_EMBED_SCRIPT)
173
+ set(WPP_EMBED_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/embed_assets.py"
174
+ CACHE PATH "Path to embed_assets.py")
175
+ endif()
176
+ message(STATUS "Using embed script: ${WPP_EMBED_SCRIPT}")