plusui-native 0.2.107 → 0.2.109

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.
@@ -1,199 +1,199 @@
1
- cmake_minimum_required(VERSION 3.16)
2
-
3
- # Enable modern MSVC debug information format (needed for /Z7 embedded debug)
4
- if(POLICY CMP0141)
5
- cmake_policy(SET CMP0141 NEW)
6
- endif()
7
-
8
- project({{PROJECT_NAME}} VERSION {{PROJECT_VERSION}} LANGUAGES CXX)
9
-
10
- set(CMAKE_CXX_STANDARD 20)
11
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
12
- set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13
-
14
- # Platform detection
15
- if(WIN32)
16
- add_definitions(-DPLUSUI_EDGE)
17
- elseif(APPLE)
18
- add_definitions(-DPLUSUI_COCOA)
19
- else()
20
- add_definitions(-DPLUSUI_GTK)
21
- endif()
22
-
23
- # Development mode flag
24
- option(PLUSUI_DEV_MODE "Enable development mode (connect to Vite dev server)" OFF)
25
- if(PLUSUI_DEV_MODE)
26
- add_definitions(-DPLUSUI_DEV_MODE)
27
- endif()
28
-
29
- # Find PlusUI Core library
30
- # Strategy: Check multiple locations for the Core library
31
- set(PLUSUI_FOUND FALSE)
32
- set(PLUSUI_CORE_DIR "")
33
-
34
- # Location 1: Project-local Core directory
35
- set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
36
- if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
37
- message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
38
- add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
39
- set(PLUSUI_FOUND TRUE)
40
- set(PLUSUI_CORE_DIR "${PLUSUI_CORE_LOCAL}")
41
- endif()
42
-
43
- # Location 2: Local development (sibling to project inside PlusUI repo)
44
- set(PLUSUI_CORE_DEV "${CMAKE_SOURCE_DIR}/../Core")
45
- if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
46
- message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
47
- add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
48
- set(PLUSUI_FOUND TRUE)
49
- set(PLUSUI_CORE_DIR "${PLUSUI_CORE_DEV}")
50
- endif()
51
-
52
- # Location 3: Installed via npm packages
53
- if(NOT PLUSUI_FOUND)
54
- set(PLUSUI_NATIVE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native")
55
- set(PLUSUI_NATIVE_NPM_CORE "${CMAKE_SOURCE_DIR}/node_modules/plusui-native/Core")
56
- set(PLUSUI_CORE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core")
57
- set(PLUSUI_CORE_NPM_LEGACY "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core/Core")
58
-
59
- if(EXISTS "${PLUSUI_NATIVE_NPM}/CMakeLists.txt")
60
- message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM}")
61
- add_subdirectory("${PLUSUI_NATIVE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
62
- set(PLUSUI_FOUND TRUE)
63
- set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM}")
64
- elseif(EXISTS "${PLUSUI_NATIVE_NPM_CORE}/CMakeLists.txt")
65
- message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM_CORE}")
66
- add_subdirectory("${PLUSUI_NATIVE_NPM_CORE}" "${CMAKE_BINARY_DIR}/plusui-core")
67
- set(PLUSUI_FOUND TRUE)
68
- set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM_CORE}")
69
- elseif(EXISTS "${PLUSUI_CORE_NPM}/CMakeLists.txt")
70
- message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_CORE_NPM}")
71
- add_subdirectory("${PLUSUI_CORE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
72
- set(PLUSUI_FOUND TRUE)
73
- set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM}")
74
- elseif(EXISTS "${PLUSUI_CORE_NPM_LEGACY}/CMakeLists.txt")
75
- message(STATUS "Found PlusUI Core in node_modules (legacy): ${PLUSUI_CORE_NPM_LEGACY}")
76
- add_subdirectory("${PLUSUI_CORE_NPM_LEGACY}" "${CMAKE_BINARY_DIR}/plusui-core")
77
- set(PLUSUI_FOUND TRUE)
78
- set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM_LEGACY}")
79
- endif()
80
- endif()
81
-
82
- # Location 4: Parent directory development structure
83
- if(NOT PLUSUI_FOUND)
84
- set(PLUSUI_CORE_PARENT "${CMAKE_SOURCE_DIR}/../../Core")
85
- if(EXISTS "${PLUSUI_CORE_PARENT}/CMakeLists.txt")
86
- message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_PARENT}")
87
- add_subdirectory("${PLUSUI_CORE_PARENT}" "${CMAKE_BINARY_DIR}/plusui-core")
88
- set(PLUSUI_FOUND TRUE)
89
- set(PLUSUI_CORE_DIR "${PLUSUI_CORE_PARENT}")
90
- endif()
91
- endif()
92
-
93
- if(NOT PLUSUI_FOUND)
94
- message(FATAL_ERROR "
95
- PlusUI Core not found!
96
-
97
- Install dependencies (npm install) or add a Core folder in this project root.
98
-
99
- Searched locations:
100
- - ${PLUSUI_CORE_LOCAL}
101
- - ${PLUSUI_CORE_DEV}
102
- - ${PLUSUI_NATIVE_NPM}
103
- - ${PLUSUI_NATIVE_NPM_CORE}
104
- - ${PLUSUI_CORE_NPM}
105
- - ${PLUSUI_CORE_NPM_LEGACY}
106
- - ${PLUSUI_CORE_PARENT}
107
- ")
108
- endif()
109
-
110
- # Validate native FileDrop support in the resolved Core
111
- if(NOT EXISTS "${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp")
112
- message(FATAL_ERROR "
113
- PlusUI Core found, but native FileDrop support is missing.
114
-
115
- Expected file:
116
- ${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp
117
-
118
- Update PlusUI Core to a version that includes FileDrop support.
119
- ")
120
- endif()
121
-
122
- # Create the executable
123
- add_executable({{PROJECT_NAME}} main.cpp)
124
-
125
- # Optional: Add your own C++ files here
126
- # file(GLOB_RECURSE MY_SOURCES "features/*.cpp")
127
- # target_sources({{PROJECT_NAME}} PRIVATE ${MY_SOURCES})
128
-
129
- # Link PlusUI library
130
- target_link_libraries({{PROJECT_NAME}} PRIVATE plusui)
131
- target_include_directories({{PROJECT_NAME}} PRIVATE ${CMAKE_SOURCE_DIR})
132
-
133
- # Platform-specific setup
134
- if(WIN32)
135
- # Windows: WebView2
136
- # Try to find WebView2 SDK headers
137
- find_path(WEBVIEW2_INCLUDE_DIR
138
- NAMES webview2.h
139
- PATHS
140
- "${CMAKE_SOURCE_DIR}/packages/Microsoft.Web.WebView2/build/native/include"
141
- "${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/include"
142
- "$ENV{USERPROFILE}/.nuget/packages/microsoft.web.webview2/1.0.2903.40/build/native/include"
143
- "$ENV{NUGET_PACKAGES}/microsoft.web.webview2/1.0.2903.40/build/native/include"
144
- "C:/Program Files (x86)/Microsoft EdgeWebView/runtimes/win-x64/native"
145
- "C:/Program Files/Microsoft EdgeWebView/runtimes/win-x64/native"
146
- )
147
-
148
- if(WEBVIEW2_INCLUDE_DIR)
149
- message(STATUS "Found WebView2 headers at: ${WEBVIEW2_INCLUDE_DIR}")
150
- target_include_directories({{PROJECT_NAME}} PRIVATE ${WEBVIEW2_INCLUDE_DIR})
151
- else()
152
- message(WARNING "WebView2 headers not found. Building may fail.")
153
- message(STATUS "Please install WebView2 SDK via NuGet:")
154
- message(STATUS " nuget install Microsoft.Web.WebView2 -OutputDirectory packages")
155
- endif()
156
-
157
- target_link_libraries({{PROJECT_NAME}} PRIVATE ole32 shell32 shlwapi user32 version)
158
- # Keep default console subsystem so standard int main() works in all build modes.
159
- elseif(APPLE)
160
- # macOS: WebKit
161
- find_library(WEBKIT_LIBRARY WebKit REQUIRED)
162
- find_library(COCOA_LIBRARY Cocoa REQUIRED)
163
- target_link_libraries({{PROJECT_NAME}} PRIVATE ${WEBKIT_LIBRARY} ${COCOA_LIBRARY})
164
-
165
- # Create app bundle for production
166
- if(NOT PLUSUI_DEV_MODE)
167
- set_target_properties({{PROJECT_NAME}} PROPERTIES
168
- MACOSX_BUNDLE TRUE
169
- MACOSX_BUNDLE_BUNDLE_NAME "{{PROJECT_NAME}}"
170
- MACOSX_BUNDLE_BUNDLE_VERSION "{{PROJECT_VERSION}}"
171
- MACOSX_BUNDLE_GUI_IDENTIFIER "com.plusui.{{PROJECT_NAME_LOWER}}"
172
- )
173
- endif()
174
- else()
175
- # Linux: GTK + WebKitGTK
176
- find_package(PkgConfig REQUIRED)
177
- pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
178
- pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.0)
179
- target_include_directories({{PROJECT_NAME}} PRIVATE ${GTK3_INCLUDE_DIRS} ${WEBKIT2_INCLUDE_DIRS})
180
- target_link_libraries({{PROJECT_NAME}} PRIVATE ${GTK3_LIBRARIES} ${WEBKIT2_LIBRARIES})
181
- endif()
182
-
183
- # Copy frontend dist files to build directory after build
184
- if(EXISTS "${CMAKE_SOURCE_DIR}/frontend/dist")
185
- add_custom_command(TARGET {{PROJECT_NAME}} POST_BUILD
186
- COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:{{PROJECT_NAME}}>/frontend"
187
- COMMAND ${CMAKE_COMMAND} -E copy_directory
188
- "${CMAKE_SOURCE_DIR}/frontend/dist"
189
- "$<TARGET_FILE_DIR:{{PROJECT_NAME}}>/frontend"
190
- COMMENT "Copying frontend files to build directory"
191
- )
192
- endif()
193
-
194
- # Set output directories for organized builds
195
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
196
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
197
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
198
-
199
-
1
+ cmake_minimum_required(VERSION 3.16)
2
+
3
+ # Enable modern MSVC debug information format (needed for /Z7 embedded debug)
4
+ if(POLICY CMP0141)
5
+ cmake_policy(SET CMP0141 NEW)
6
+ endif()
7
+
8
+ project({{PROJECT_NAME_LOWER}} VERSION {{PROJECT_VERSION}} LANGUAGES CXX)
9
+
10
+ set(CMAKE_CXX_STANDARD 20)
11
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
12
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13
+
14
+ # Platform detection
15
+ if(WIN32)
16
+ add_definitions(-DPLUSUI_EDGE)
17
+ elseif(APPLE)
18
+ add_definitions(-DPLUSUI_COCOA)
19
+ else()
20
+ add_definitions(-DPLUSUI_GTK)
21
+ endif()
22
+
23
+ # Development mode flag
24
+ option(PLUSUI_DEV_MODE "Enable development mode (connect to Vite dev server)" OFF)
25
+ if(PLUSUI_DEV_MODE)
26
+ add_definitions(-DPLUSUI_DEV_MODE)
27
+ endif()
28
+
29
+ # Find PlusUI Core library
30
+ # Strategy: Check multiple locations for the Core library
31
+ set(PLUSUI_FOUND FALSE)
32
+ set(PLUSUI_CORE_DIR "")
33
+
34
+ # Location 1: Project-local Core directory
35
+ set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
36
+ if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
37
+ message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
38
+ add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
39
+ set(PLUSUI_FOUND TRUE)
40
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_LOCAL}")
41
+ endif()
42
+
43
+ # Location 2: Local development (sibling to project inside PlusUI repo)
44
+ set(PLUSUI_CORE_DEV "${CMAKE_SOURCE_DIR}/../Core")
45
+ if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
46
+ message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
47
+ add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
48
+ set(PLUSUI_FOUND TRUE)
49
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_DEV}")
50
+ endif()
51
+
52
+ # Location 3: Installed via npm packages
53
+ if(NOT PLUSUI_FOUND)
54
+ set(PLUSUI_NATIVE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native")
55
+ set(PLUSUI_NATIVE_NPM_CORE "${CMAKE_SOURCE_DIR}/node_modules/plusui-native/Core")
56
+ set(PLUSUI_CORE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core")
57
+ set(PLUSUI_CORE_NPM_LEGACY "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core/Core")
58
+
59
+ if(EXISTS "${PLUSUI_NATIVE_NPM}/CMakeLists.txt")
60
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM}")
61
+ add_subdirectory("${PLUSUI_NATIVE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
62
+ set(PLUSUI_FOUND TRUE)
63
+ set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM}")
64
+ elseif(EXISTS "${PLUSUI_NATIVE_NPM_CORE}/CMakeLists.txt")
65
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM_CORE}")
66
+ add_subdirectory("${PLUSUI_NATIVE_NPM_CORE}" "${CMAKE_BINARY_DIR}/plusui-core")
67
+ set(PLUSUI_FOUND TRUE)
68
+ set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM_CORE}")
69
+ elseif(EXISTS "${PLUSUI_CORE_NPM}/CMakeLists.txt")
70
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_CORE_NPM}")
71
+ add_subdirectory("${PLUSUI_CORE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
72
+ set(PLUSUI_FOUND TRUE)
73
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM}")
74
+ elseif(EXISTS "${PLUSUI_CORE_NPM_LEGACY}/CMakeLists.txt")
75
+ message(STATUS "Found PlusUI Core in node_modules (legacy): ${PLUSUI_CORE_NPM_LEGACY}")
76
+ add_subdirectory("${PLUSUI_CORE_NPM_LEGACY}" "${CMAKE_BINARY_DIR}/plusui-core")
77
+ set(PLUSUI_FOUND TRUE)
78
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM_LEGACY}")
79
+ endif()
80
+ endif()
81
+
82
+ # Location 4: Parent directory development structure
83
+ if(NOT PLUSUI_FOUND)
84
+ set(PLUSUI_CORE_PARENT "${CMAKE_SOURCE_DIR}/../../Core")
85
+ if(EXISTS "${PLUSUI_CORE_PARENT}/CMakeLists.txt")
86
+ message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_PARENT}")
87
+ add_subdirectory("${PLUSUI_CORE_PARENT}" "${CMAKE_BINARY_DIR}/plusui-core")
88
+ set(PLUSUI_FOUND TRUE)
89
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_PARENT}")
90
+ endif()
91
+ endif()
92
+
93
+ if(NOT PLUSUI_FOUND)
94
+ message(FATAL_ERROR "
95
+ PlusUI Core not found!
96
+
97
+ Install dependencies (npm install) or add a Core folder in this project root.
98
+
99
+ Searched locations:
100
+ - ${PLUSUI_CORE_LOCAL}
101
+ - ${PLUSUI_CORE_DEV}
102
+ - ${PLUSUI_NATIVE_NPM}
103
+ - ${PLUSUI_NATIVE_NPM_CORE}
104
+ - ${PLUSUI_CORE_NPM}
105
+ - ${PLUSUI_CORE_NPM_LEGACY}
106
+ - ${PLUSUI_CORE_PARENT}
107
+ ")
108
+ endif()
109
+
110
+ # Validate native FileDrop support in the resolved Core
111
+ if(NOT EXISTS "${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp")
112
+ message(FATAL_ERROR "
113
+ PlusUI Core found, but native FileDrop support is missing.
114
+
115
+ Expected file:
116
+ ${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp
117
+
118
+ Update PlusUI Core to a version that includes FileDrop support.
119
+ ")
120
+ endif()
121
+
122
+ # Create the executable
123
+ add_executable({{PROJECT_NAME_LOWER}} main.cpp)
124
+
125
+ # Optional: Add your own C++ files here
126
+ # file(GLOB_RECURSE MY_SOURCES "features/*.cpp")
127
+ # target_sources({{PROJECT_NAME_LOWER}} PRIVATE ${MY_SOURCES})
128
+
129
+ # Link PlusUI library
130
+ target_link_libraries({{PROJECT_NAME_LOWER}} PRIVATE plusui)
131
+ target_include_directories({{PROJECT_NAME_LOWER}} PRIVATE ${CMAKE_SOURCE_DIR})
132
+
133
+ # Platform-specific setup
134
+ if(WIN32)
135
+ # Windows: WebView2
136
+ # Try to find WebView2 SDK headers
137
+ find_path(WEBVIEW2_INCLUDE_DIR
138
+ NAMES webview2.h
139
+ PATHS
140
+ "${CMAKE_SOURCE_DIR}/packages/Microsoft.Web.WebView2/build/native/include"
141
+ "${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/include"
142
+ "$ENV{USERPROFILE}/.nuget/packages/microsoft.web.webview2/1.0.2903.40/build/native/include"
143
+ "$ENV{NUGET_PACKAGES}/microsoft.web.webview2/1.0.2903.40/build/native/include"
144
+ "C:/Program Files (x86)/Microsoft EdgeWebView/runtimes/win-x64/native"
145
+ "C:/Program Files/Microsoft EdgeWebView/runtimes/win-x64/native"
146
+ )
147
+
148
+ if(WEBVIEW2_INCLUDE_DIR)
149
+ message(STATUS "Found WebView2 headers at: ${WEBVIEW2_INCLUDE_DIR}")
150
+ target_include_directories({{PROJECT_NAME_LOWER}} PRIVATE ${WEBVIEW2_INCLUDE_DIR})
151
+ else()
152
+ message(WARNING "WebView2 headers not found. Building may fail.")
153
+ message(STATUS "Please install WebView2 SDK via NuGet:")
154
+ message(STATUS " nuget install Microsoft.Web.WebView2 -OutputDirectory packages")
155
+ endif()
156
+
157
+ target_link_libraries({{PROJECT_NAME_LOWER}} PRIVATE ole32 shell32 shlwapi user32 version)
158
+ # Keep default console subsystem so standard int main() works in all build modes.
159
+ elseif(APPLE)
160
+ # macOS: WebKit
161
+ find_library(WEBKIT_LIBRARY WebKit REQUIRED)
162
+ find_library(COCOA_LIBRARY Cocoa REQUIRED)
163
+ target_link_libraries({{PROJECT_NAME_LOWER}} PRIVATE ${WEBKIT_LIBRARY} ${COCOA_LIBRARY})
164
+
165
+ # Create app bundle for production
166
+ if(NOT PLUSUI_DEV_MODE)
167
+ set_target_properties({{PROJECT_NAME_LOWER}} PROPERTIES
168
+ MACOSX_BUNDLE TRUE
169
+ MACOSX_BUNDLE_BUNDLE_NAME "{{PROJECT_NAME_LOWER}}"
170
+ MACOSX_BUNDLE_BUNDLE_VERSION "{{PROJECT_VERSION}}"
171
+ MACOSX_BUNDLE_GUI_IDENTIFIER "com.plusui.{{PROJECT_NAME_LOWER}}"
172
+ )
173
+ endif()
174
+ else()
175
+ # Linux: GTK + WebKitGTK
176
+ find_package(PkgConfig REQUIRED)
177
+ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
178
+ pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.0)
179
+ target_include_directories({{PROJECT_NAME_LOWER}} PRIVATE ${GTK3_INCLUDE_DIRS} ${WEBKIT2_INCLUDE_DIRS})
180
+ target_link_libraries({{PROJECT_NAME_LOWER}} PRIVATE ${GTK3_LIBRARIES} ${WEBKIT2_LIBRARIES})
181
+ endif()
182
+
183
+ # Copy frontend dist files to build directory after build
184
+ if(EXISTS "${CMAKE_SOURCE_DIR}/frontend/dist")
185
+ add_custom_command(TARGET {{PROJECT_NAME_LOWER}} POST_BUILD
186
+ COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:{{PROJECT_NAME_LOWER}}>/frontend"
187
+ COMMAND ${CMAKE_COMMAND} -E copy_directory
188
+ "${CMAKE_SOURCE_DIR}/frontend/dist"
189
+ "$<TARGET_FILE_DIR:{{PROJECT_NAME_LOWER}}>/frontend"
190
+ COMMENT "Copying frontend files to build directory"
191
+ )
192
+ endif()
193
+
194
+ # Set output directories for organized builds
195
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
196
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
197
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
198
+
199
+
@@ -1,36 +1,36 @@
1
- import { defineConfig } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
- import { resolve, dirname } from 'path';
4
- import { fileURLToPath } from 'url';
5
- import { existsSync } from 'fs';
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = dirname(__filename);
9
-
10
- function findPlusuiEntry(): string {
11
- const candidates = [
12
- resolve(__dirname, '../../Core/Features/API/index.ts'),
13
- resolve(__dirname, '../node_modules/plusui-native-core/Core/Features/API/index.ts'),
14
- ];
15
- for (const p of candidates) {
16
- if (existsSync(p)) return p;
17
- }
18
- return 'plusui-native-core';
19
- }
20
-
21
- export default defineConfig({
22
- plugins: [react()],
23
- resolve: {
24
- alias: {
25
- plusui: findPlusuiEntry(),
26
- },
27
- },
28
- build: {
29
- outDir: 'dist',
30
- emptyOutDir: true,
31
- },
32
- server: {
33
- port: 5173,
34
- strictPort: false,
35
- },
36
- });
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import { resolve, dirname } from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ import { existsSync } from 'fs';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+
10
+ function findPlusuiEntry(): string {
11
+ const candidates = [
12
+ resolve(__dirname, '../../Core/Features/API/index.ts'),
13
+ resolve(__dirname, '../node_modules/plusui-native-core/Core/Features/API/index.ts'),
14
+ ];
15
+ for (const p of candidates) {
16
+ if (existsSync(p)) return p;
17
+ }
18
+ return 'plusui-native-core';
19
+ }
20
+
21
+ export default defineConfig({
22
+ plugins: [react()],
23
+ resolve: {
24
+ alias: {
25
+ plusui: findPlusuiEntry(),
26
+ },
27
+ },
28
+ build: {
29
+ outDir: 'dist',
30
+ emptyOutDir: true,
31
+ },
32
+ server: {
33
+ port: 5173,
34
+ strictPort: false,
35
+ },
36
+ });