-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
2572 lines (2391 loc) · 106 KB
/
Copy pathCMakeLists.txt
File metadata and controls
2572 lines (2391 loc) · 106 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
cmake_minimum_required(VERSION 3.24)
include("${CMAKE_SOURCE_DIR}/cmake/SnowDesktop.SharedBuildGuard.cmake")
snowdesktop_check_shared_output()
project(SnowDesktop LANGUAGES C CXX)
# WinUI 3 XAML compilation and NuGet PackageReference integration are MSBuild
# features. Keeping this requirement explicit avoids silently generating a
# project that can compile the native host but cannot generate the XAML/WinRT
# sources required by the settings UI.
if (NOT CMAKE_GENERATOR MATCHES "^Visual Studio ")
message(FATAL_ERROR
"SnowDesktop WinUI 3 requires a Visual Studio/MSBuild generator")
endif()
include("${CMAKE_SOURCE_DIR}/cmake/SnowDesktop.CompileParallelism.cmake")
file(READ "${CMAKE_SOURCE_DIR}/version.json" VERSION_JSON)
string(JSON SNOWDESKTOP_VERSION GET "${VERSION_JSON}" "version")
file(READ
"${CMAKE_SOURCE_DIR}/packaging/store-identity.json"
STORE_IDENTITY_JSON)
string(JSON SNOWDESKTOP_STORE_ID
GET "${STORE_IDENTITY_JSON}" "storeId")
string(JSON SNOWDESKTOP_PACKAGE_FAMILY_NAME
GET "${STORE_IDENTITY_JSON}" "packageFamilyName")
string(LENGTH "${SNOWDESKTOP_STORE_ID}" SNOWDESKTOP_STORE_ID_LENGTH)
if (NOT SNOWDESKTOP_STORE_ID MATCHES "^[A-Z0-9]+$" OR
NOT SNOWDESKTOP_STORE_ID_LENGTH EQUAL 12)
message(FATAL_ERROR
"packaging/store-identity.json contains an invalid Store ID")
endif()
if (SNOWDESKTOP_PACKAGE_FAMILY_NAME STREQUAL "")
message(FATAL_ERROR
"packaging/store-identity.json contains an empty package family name")
endif()
file(READ
"${CMAKE_SOURCE_DIR}/packaging/steam-identity.json"
STEAM_IDENTITY_JSON)
string(JSON SNOWDESKTOP_STEAM_APP_ID
GET "${STEAM_IDENTITY_JSON}" "appId")
string(JSON SNOWDESKTOP_STEAM_WINDOWS_DEPOT_ID
GET "${STEAM_IDENTITY_JSON}" "windowsDepotId")
foreach(STEAM_ID IN ITEMS
SNOWDESKTOP_STEAM_APP_ID
SNOWDESKTOP_STEAM_WINDOWS_DEPOT_ID)
if (NOT ${STEAM_ID} MATCHES "^[1-9][0-9]*$" OR
${STEAM_ID} GREATER 4294967295)
message(FATAL_ERROR
"packaging/steam-identity.json contains an invalid Steam ID")
endif()
endforeach()
string(REPLACE "." ";" SNOWDESKTOP_VERSION_PARTS "${SNOWDESKTOP_VERSION}")
list(LENGTH SNOWDESKTOP_VERSION_PARTS SNOWDESKTOP_VERSION_PART_COUNT)
if (NOT SNOWDESKTOP_VERSION_PART_COUNT EQUAL 4)
message(FATAL_ERROR
"version.json must contain a four-part version: A.B.C.D")
endif()
foreach(VERSION_PART IN LISTS SNOWDESKTOP_VERSION_PARTS)
if (NOT VERSION_PART MATCHES "^(0|[1-9][0-9]*)$")
message(FATAL_ERROR
"Version components must be canonical non-negative integers: ${SNOWDESKTOP_VERSION}")
endif()
if (VERSION_PART GREATER 65535)
message(FATAL_ERROR
"Each version component must be between 0 and 65535: ${SNOWDESKTOP_VERSION}")
endif()
endforeach()
list(GET SNOWDESKTOP_VERSION_PARTS 0 SNOWDESKTOP_VERSION_MAJOR)
list(GET SNOWDESKTOP_VERSION_PARTS 1 SNOWDESKTOP_VERSION_MINOR)
list(GET SNOWDESKTOP_VERSION_PARTS 2 SNOWDESKTOP_VERSION_PATCH)
list(GET SNOWDESKTOP_VERSION_PARTS 3 SNOWDESKTOP_VERSION_REVISION)
if (SNOWDESKTOP_VERSION_MAJOR EQUAL 0)
message(FATAL_ERROR
"The first version component must be greater than zero for MSIX packages")
endif()
if (NOT SNOWDESKTOP_VERSION_REVISION EQUAL 0)
message(FATAL_ERROR
"The fourth version component must be zero for Microsoft Store submissions")
endif()
set(SNOWDESKTOP_VERSION_RESOURCE_DIR
"${CMAKE_BINARY_DIR}/generated/version")
file(MAKE_DIRECTORY "${SNOWDESKTOP_VERSION_RESOURCE_DIR}")
set(SNOWDESKTOP_FILE_DESCRIPTION "SnowDesktop")
set(SNOWDESKTOP_ORIGINAL_FILENAME "SnowDesktop.exe")
set(SNOWDESKTOP_FILE_TYPE "VFT_APP")
set(SNOWDESKTOP_LEGAL_COPYRIGHT
"Copyright (c) SnowDesktop contributors; portions copyright (c) TranslucentTB contributors")
set(SNOWDESKTOP_EXE_VERSION_RESOURCE
"${SNOWDESKTOP_VERSION_RESOURCE_DIR}/SnowDesktop.version.rc")
configure_file(
"${CMAKE_SOURCE_DIR}/src/resources/version.rc.in"
"${SNOWDESKTOP_EXE_VERSION_RESOURCE}"
@ONLY)
set(SNOWDESKTOP_FILE_DESCRIPTION "SnowDesktop Steam launcher")
set(SNOWDESKTOP_ORIGINAL_FILENAME "SnowDesktopLauncher.exe")
set(SNOWDESKTOP_FILE_TYPE "VFT_APP")
set(SNOWDESKTOP_LEGAL_COPYRIGHT
"Copyright (c) SnowDesktop contributors")
set(SNOWDESKTOP_LAUNCHER_VERSION_RESOURCE
"${SNOWDESKTOP_VERSION_RESOURCE_DIR}/SnowDesktopLauncher.version.rc")
configure_file(
"${CMAKE_SOURCE_DIR}/src/resources/version.rc.in"
"${SNOWDESKTOP_LAUNCHER_VERSION_RESOURCE}"
@ONLY)
set(SNOWDESKTOP_FILE_DESCRIPTION "SnowDesktop taskbar hook")
set(SNOWDESKTOP_ORIGINAL_FILENAME "SnowDesktopTaskbarHook.dll")
set(SNOWDESKTOP_FILE_TYPE "VFT_DLL")
set(SNOWDESKTOP_LEGAL_COPYRIGHT
"Copyright (c) SnowDesktop contributors; portions copyright (c) TranslucentTB contributors")
set(SNOWDESKTOP_TASKBAR_HOOK_VERSION_RESOURCE
"${SNOWDESKTOP_VERSION_RESOURCE_DIR}/SnowDesktopTaskbarHook.version.rc")
configure_file(
"${CMAKE_SOURCE_DIR}/src/resources/version.rc.in"
"${SNOWDESKTOP_TASKBAR_HOOK_VERSION_RESOURCE}"
@ONLY)
message(STATUS "SnowDesktop version: ${SNOWDESKTOP_VERSION}")
message(STATUS
"SnowDesktop Steam App/Windows Depot: ${SNOWDESKTOP_STEAM_APP_ID}/${SNOWDESKTOP_STEAM_WINDOWS_DEPOT_ID}")
# Keep native WinUI and C++/WinRT PackageReferences on one repository-wide
# version so helper targets can use the same restored tools on a clean build.
set(SNOWDESKTOP_WINDOWSAPPSDK_PACKAGE_VERSION "2.4.0")
set(SNOWDESKTOP_CPPWINRT_PACKAGE_VERSION "3.0.260818.1")
set(SNOWDESKTOP_SYSTEM_CONTROL_SOURCES
src/system/controls/system_controls.cpp
src/system/controls/system_control_windows.cpp
src/system/controls/system_control_audio.cpp
src/system/controls/system_control_power.cpp
src/system/controls/system_control_brightness.cpp
src/system/controls/system_control_wifi.cpp
src/system/controls/system_control_bluetooth.cpp
src/system/controls/system_control_media.cpp
src/system/controls/system_control_quick_actions.cpp)
set(SNOWDESKTOP_SYSTEM_CONTROL_LIBRARIES
dxva2 wlanapi powrprof setupapi oleaut32 wbemuuid)
set(SNOWDESKTOP_SOURCES
${SNOWDESKTOP_SYSTEM_CONTROL_SOURCES}
src/main.cpp
src/platform/auto_start_manager.cpp
src/platform/auto_start_manager.h
src/platform/auto_start_elevation.cpp
src/platform/auto_start_elevation.h
src/platform/auto_start_rules.h
src/platform/application_crash_watchdog.cpp
src/desktop/desktop_namespace_registry.cpp
src/desktop/desktop_namespace_registry.h
src/icons/icon_beautify.cpp
src/app/render/app_bitmap_cache.cpp
src/app/menus/app_background_menu.cpp
src/app/render/app_animation_scheduler.cpp
src/app/input/app_clipboard_interaction.cpp
src/app/render/app_composition_animation_overlay.cpp
src/app/popup/app_container_navigation.cpp
src/app/drag_drop/app_data_object.cpp
src/app/shell/app_desktop_enumeration.cpp
src/app/render/app_desktop_foreground_composition.cpp
src/app/layout/app_desktop_layout.cpp
src/app/shell/app_desktop_reload.cpp
src/app/dock/app_dock_drop.cpp
src/app/dock/app_dock_launch.cpp
src/app/dock/app_dock_layout.cpp
src/dock/dock_appbar.cpp
src/dock/dock_appbar.h
src/app/features/app_status_bar.cpp
src/system/status_bar/status_bar_view.cpp
src/system/status_bar/status_bar_view.h
src/system/status_bar/status_bar_preview.cpp
src/system/status_bar/status_bar_preview.h
src/system/status_bar/status_bar.cpp
src/system/status_bar/status_bar_input_method.cpp
src/system/status_bar/status_bar_input_method.h
src/system/status_bar/status_bar_notification.cpp
src/system/status_bar/status_bar_notification.h
src/system/tray/tray_service.cpp
src/system/tray/tray_menu_placement.cpp
src/system/tray/tray_menu_placement.h
src/ui/render/native_tooltip.cpp
src/ui/render/native_tooltip.h
src/ui/render/native_tooltip_content.h
src/ui/render/native_tooltip_state.h
src/ui/render/native_control_geometry.h
src/system/tray/tray_model.cpp
src/system/tray/tray_service.h
src/system/tray/tray_focus.h
src/taskbar_hook/tray_protocol.h
src/system/status_bar/status_bar.h
src/system/status_bar/status_bar_shell_shortcut.h
src/system/status_bar/status_bar_interaction.h
src/system/status_bar/status_bar_settings.h
src/system/status_bar/status_bar_appbar.h
src/app/dock/app_dock_menu.cpp
src/app/dock/app_dock_model.cpp
src/app/dock/app_dock_render.cpp
src/app/dock/app_dock_window_control.cpp
src/app/dock/app_dock_window_tracking.cpp
src/app/drag_drop/app_drag_hint_window.cpp
src/app/drag_drop/app_drag_lifecycle.cpp
src/app/drag_drop/app_drag_preview_window.cpp
src/app/drag_drop/app_drag_target_update.cpp
src/drag_drop/drop_data_url.cpp
src/drag_drop/drop_data_url.h
src/drag_drop/drop_image_data.cpp
src/drag_drop/drop_image_data.h
src/drag_drop/drop_text_rules.cpp
src/drag_drop/drop_text_rules.h
src/app/drag_drop/app_drop_data_extraction.cpp
src/drag_drop/external_drop_content.cpp
src/app/drag_drop/app_url_drop_download.cpp
src/app/features/app_website_icon.cpp
src/icons/website_icon.cpp
src/app/drag_drop/app_drop_execution.cpp
src/app/drag_drop/app_external_slot_drop.cpp
src/app/drag_drop/app_drop_preview.cpp
src/app/drag_drop/app_drop_render.cpp
src/app/dock/app_floating_dock_interaction.cpp
src/app/dock/app_floating_dock_lifecycle.cpp
src/app/dock/app_floating_dock_render.cpp
src/app/dock/app_floating_dock_window.cpp
src/app/popup/app_floating_popup_window.cpp
src/app/render/app_graphics_device.cpp
src/app/render/app_glass_render.cpp
src/app/layout/app_grid_drag.cpp
src/app/layout/app_grid_placement.cpp
src/app/input/app_hit_testing.cpp
src/app/render/app_icon_loader.cpp
src/app/render/app_icon_render.cpp
src/app/layout/app_item_sorting.cpp
src/app/menus/app_item_menu.cpp
src/app/input/app_keyboard_input.cpp
src/app/input/app_keyboard_navigation.cpp
src/app/layout/app_layout.cpp
src/app/features/app_large_icons.cpp
src/app/features/app_large_icon_interaction.cpp
src/icons/large_icon_assets.cpp
src/icons/large_icon_renderer.cpp
src/app/lifecycle/app_lifecycle.cpp
src/app/widgets/app_lua_panel.cpp
src/app/widgets/app_lua_panel_render.cpp
src/app/widgets/app_lua_bridge.cpp
src/app/menus/app_menu_icons.cpp
src/app/lifecycle/app_message_dispatch.cpp
src/shell/shell_context_menu_site.cpp
src/desktop/windows_desktop_layout.cpp
src/shell/shell_launch_worker.cpp
src/shell/shell_launch_process.cpp
src/shell/shell_extension_menu.cpp
src/shell/shell_extension_menu_cache.cpp
src/shell/shell_extension_catalogue.cpp
src/shell/shell_extension_service.cpp
src/shell/shell_file_operation_worker.cpp
src/app/render/app_navigation_render.cpp
src/app/drag_drop/app_ole_drop_routing.cpp
src/app/drag_drop/app_ole_drop_session.cpp
src/app/render/app_overlay_render.cpp
src/app/layout/app_page_grid.cpp
src/app/render/app_paint.cpp
src/app/input/app_pointer_context.cpp
src/app/input/app_pointer_down.cpp
src/app/input/app_pointer_move.cpp
src/app/input/app_pointer_release.cpp
src/app/popup/app_popup_geometry.cpp
src/app/popup/app_popup_dwell_interaction.cpp
src/app/popup/app_popup_lifecycle.cpp
src/app/popup/app_popup_render.cpp
src/app/popup/app_popup_transition.cpp
src/app/navigation/app_quick_navigation_interaction.cpp
src/app/navigation/app_quick_navigation_features.cpp
src/app/navigation/app_quick_navigation_preview.cpp
src/app/features/app_theme_preview.cpp
src/app/navigation/app_quick_navigation_layout.cpp
src/app/navigation/app_quick_navigation_messages.cpp
src/app/navigation/app_quick_navigation_model.cpp
src/app/navigation/app_quick_navigation_render.cpp
src/app/navigation/app_quick_navigation_window.cpp
src/app/input/app_rename_begin.cpp
src/app/input/app_rename_commit.cpp
src/app/input/app_rename_editor.cpp
src/app/input/app_rename_target.cpp
src/app/render/app_render_geometry.cpp
src/app/render/app_render_primitives.cpp
src/app/lifecycle/app_run.cpp
src/app/features/app_usage_guide.cpp
src/platform/usage_guide.cpp
src/platform/usage_guide.h
src/app/shell/app_shell_context_menu.cpp
src/app/shell/app_shell_file_operation.cpp
src/app/shell/app_shell_menu.cpp
src/app/render/app_scene_render.cpp
src/app/input/app_scroll_interaction.cpp
src/app/input/app_selection_interaction.cpp
src/app/lifecycle/app_settings_apply.cpp
src/app/input/desktop_passthrough_indicator.cpp
src/app/render/app_text_render.cpp
src/app/features/app_taskbar_integration.cpp
src/app/features/app_steam_workshop.cpp
src/app/lifecycle/app_timer_dispatch.cpp
src/app/tray/app_tray.cpp
src/app/lifecycle/app_window_dispatch.cpp
src/app/widgets/app_widget_context_menu.cpp
src/app/widgets/app_widget_grouping.cpp
src/app/widgets/app_widget_marquee_composition.cpp
src/app/widgets/app_widget_composition.cpp
src/app/widgets/app_widget_placement.cpp
src/app/widgets/app_widget_refresh.cpp
src/app/drag_drop/drag_drop_controller.cpp
src/app/drag_drop/drag_render_cache.cpp
src/app/drag_drop/ole_drag_drop_adapter.cpp
src/app/tray/tray_icon_controller.cpp
src/app/widgets/widget_notification_presenter.cpp
src/app/render/desktop_backdrop_compositor.cpp
src/app/lifecycle/startup_animation.cpp
src/app/features/wallpaper_engine_capture.cpp
src/data/atomic_file.cpp
src/dock/dock_window_preview.cpp
src/dock/dock_window_transition.cpp
src/core/item.cpp
src/core/drag_target_resolver.cpp
src/core/dock.cpp
src/core/slot.cpp
src/core/container.cpp
src/core/desktop.cpp
src/data/data_paths.cpp
src/drag_drop/virtual_file_drop.cpp
src/drag_drop/virtual_file_drop.h
src/drag_drop/url_drop_download_worker.cpp
src/drag_drop/url_drop_download_worker.h
src/drag_drop/url_drop_resource.cpp
src/drag_drop/url_drop_resource.h
src/steam/steam_runtime_context.cpp
src/steam/steam_runtime_context.h
src/steam/steam_entitlement.cpp
src/steam/steam_entitlement.h
src/system/calendar/calendar_service.cpp
src/system/calendar/calendar_display.cpp
src/data/full_data_backup.cpp
src/data/portable_data_migration.cpp
src/platform/single_instance.cpp
src/diagnostics/debug_profile.cpp
src/platform/deployment_context.cpp
src/icons/shortcut_icon_resource.cpp
src/icons/shortcut_icon_resource.h
src/common/utils.cpp
src/platform/operation_feedback.cpp
src/desktop/desktop_display_settings.h
src/settings/settings_controller.cpp
src/settings/settings_controller.h
src/settings/settings_route.cpp
src/settings/settings_route.h
src/settings/settings_search_index.cpp
src/settings/settings_search_index.h
src/settings/settings_store_native.cpp
src/settings/settings_window.cpp
src/settings/settings_ipc_channel.cpp
src/settings/settings_ipc_services.cpp
src/settings/settings_ipc_widget_service.cpp
src/settings/settings_process.cpp
src/winui/settings_ipc_backends.cpp
src/winui/settings_process_entry.cpp
src/winui/App.idl
src/winui/App.xaml
src/winui/App.xaml.cpp
src/winui/App.xaml.h
src/winui/backup_data_page_backend.cpp
src/winui/backup_data_page_backend.h
src/winui/backup_data_page_presenter.cpp
src/winui/backup_data_page_presenter.h
src/winui/desktop_page_presenter.cpp
src/winui/desktop_page_presenter.h
src/winui/dock_page_presenter.cpp
src/winui/status_bar_page_presenter.cpp
src/winui/desktop_style_page_presenter.cpp
src/winui/desktop_style_page_presenter.h
src/ui/render/native_ui_scene.cpp
src/ui/render/native_ui_scene.h
src/system/panel/system_panel.cpp
src/system/controls/system_control_prompt.cpp
src/system/panel/system_panel.h
src/system/panel/system_panel_model.cpp
src/system/panel/system_panel_model.h
src/system/calendar/system_calendar_editor.cpp
src/system/calendar/system_calendar_editor.h
src/system/calendar/system_calendar_editor_state.h
src/system/panel/system_panel_preview.cpp
src/system/panel/system_panel_preview.h
src/winui/status_bar_page_presenter.h
src/winui/calendar_page_presenter.cpp
src/winui/calendar_page_presenter.h
src/winui/context_menu_page_presenter.cpp
src/winui/context_menu_page_presenter.h
src/winui/animation_performance_page_presenter.cpp
src/winui/animation_performance_page_presenter.h
src/winui/dock_page_presenter.h
src/winui/SettingsShell.xaml
src/winui/SettingsShell.xaml.cpp
src/winui/SettingsShell.xaml.h
src/winui/general_page_presenter.cpp
src/winui/general_page_presenter.h
src/winui/home_about_page_presenter.cpp
src/winui/start_page_presenter.cpp
src/winui/start_page_presenter.h
src/winui/home_about_page_presenter.h
src/winui/home_about_page_model.h
src/winui/hotkey_recorder.cpp
src/winui/hotkey_recorder.h
src/winui/hotkey_recorder_rules.h
src/winui/page_layout_page_presenter.cpp
src/winui/large_icon_page_presenter.cpp
src/winui/large_icon_page_presenter.h
src/winui/page_layout_page_presenter.h
src/winui/personalization_page_presenter.cpp
src/winui/personalization_page_presenter.h
src/winui/pch.h
src/winui/settings_shell_navigation.cpp
src/winui/settings_shell_navigation.h
src/winui/settings_window_host.cpp
src/winui/settings_window_host.h
src/winui/widget_settings_presenter.cpp
src/winui/widget_settings_presenter.h
src/winui/widgets_page_backend.cpp
src/winui/widgets_page_backend.h
src/winui/widgets_page_presenter.cpp
src/winui/widgets_page_presenter.h
src/winui/winui_runtime.cpp
src/winui/winui_runtime.h
src/winui/xaml_metadata_provider_bridge.cpp
src/winui/xaml_type_info_bridge.cpp
src/winui/xaml_type_info_impl_bridge.cpp
src/ui/render/ui_animation_scheduler.cpp
src/theme/personalization.cpp
src/theme/personalization_path.cpp
src/theme/theme_library.cpp
src/theme/theme_preview.cpp
src/theme/theme_workshop.cpp
src/dock/dock_settings.cpp
src/taskbar_hook/taskbar_symbol_resolver.cpp
src/navigation/navigation_settings.cpp
src/settings/general_settings.cpp
src/ui/render/app_font.cpp
src/settings/category_settings.cpp
src/ui/preview/component_preview.cpp
src/ui/preview/native_component_preview_export.cpp
src/ui/preview/preview_png_writer.cpp
src/widget/authoring/widget_author_preview.cpp
src/widget/preview/widget_preview_stage.cpp
src/widget/preview/widget_preview_scene.cpp
src/widget/preview/widget_preview_scene_model.cpp
src/common/l10n.cpp
src/layout/item_location.cpp
src/data/layout_storage.cpp
src/ui/menu/menu_icon_render.cpp
src/ui/menu/menu_builtin_icon.cpp
src/ui/menu/modern_menu.cpp
src/navigation/search_match.cpp
src/navigation/everything_search.cpp
src/navigation/quick_navigation_everything_search.cpp
src/navigation/quick_navigation_search_async.cpp
src/widget/runtime/lua_runtime.cpp
src/widget/api/widget_api_registry.cpp
src/widget/packages/widget_package_image_cache.cpp
src/widget/runtime/widget_l10n_format.cpp
src/widget/runtime/widget_time.cpp
src/widget/preview/widget_preview_context.cpp
src/widget/data/widget_data_broker.cpp
src/widget/tasks/widget_task_broker.cpp
src/widget/tasks/widget_location_task_executor.cpp
src/widget/tasks/widget_notification_runtime.cpp
src/widget/tasks/widget_notification_schedule_store.cpp
src/widget/tasks/widget_media_task_executor.cpp
src/widget/tasks/widget_audio_output_task_executor.cpp
src/widget/tasks/widget_system_control_tasks.cpp
src/widget/tasks/widget_clipboard_task_executor.cpp
src/widget/tasks/widget_filesystem_handle_store.cpp
src/widget/tasks/widget_filesystem_task_executor.cpp
src/widget/tasks/widget_filesystem_watch_service.cpp
src/widget/tasks/widget_app_task_executor.cpp
src/widget/settings/widget_system_settings.cpp
src/widget/data/widget_system_data_provider.cpp
src/widget/data/widget_gpu_sampler.cpp
src/widget/data/widget_audio_analysis_provider.cpp
src/widget/view/widget_draw_geometry.cpp
src/widget/view/widget_background_cache.cpp
src/widget/view/widget_interaction_region.cpp
src/widget/view/widget_accessibility_events.cpp
src/widget/view/widget_accessibility_provider.cpp
src/widget/view/widget_view_accessibility.cpp
src/widget/api/widget_view_contract.cpp
src/widget/view/widget_view_tree.cpp
src/widget/view/widget_view_lua.cpp
src/widget/view/widget_text_input_rules.cpp
src/widget/storage/widget_storage_transaction.cpp
src/widget/storage/widget_storage_value.cpp
src/widget/storage/widget_storage_write_budget.cpp
src/widget/storage/widget_secret_store.cpp
src/widget/settings/widget_settings_model.h
src/widget/settings/widget_settings_service.cpp
src/widget/settings/widget_settings_service.h
src/widget/settings/widget_engine_settings_backend.cpp
src/widget/settings/widget_engine_settings_backend.h
src/widget/settings/widget_setting_rules.cpp
src/widget/runtime/widget_logical_slot.cpp
src/widget/runtime/widget_lua_lifecycle.cpp
src/widget/runtime/widget_runtime_diagnostics.cpp
src/diagnostics/performance_capture.cpp
src/widget/runtime/widget_runtime_scheduler.cpp
src/widget/runtime/widget_engine.cpp
src/widget/permissions/widget_permission_broker.cpp
src/widget/permissions/widget_permission_state.cpp
src/widget/packages/widget_package.cpp
src/widget/packages/widget_package_paths.cpp
src/steam/steam_workshop_cache.cpp
src/steam/steam_workshop_source.cpp
src/steam/steam_workshop_sync.cpp
src/system/system_snapshot.cpp
src/platform/http_runtime.cpp
src/widgets/widget_base.cpp
src/widgets/collection.cpp
src/widgets/collection_group.cpp
src/widgets/file_group.cpp
src/widgets/file_categories.cpp
src/widgets/folder_mapping.cpp
src/widgets/lua_script.cpp
src/widgets/lua_logical_slot.cpp
src/widgets/guide_widget.cpp
)
set(EVERYTHING_SOURCES
third_party/everything/src/Everything.c
)
set(PINYIN_DATA_SOURCES
third_party/pinyin-data/pinyin_full_table.cpp
)
set(IMGUI_SOURCES
third_party/imgui/imgui.cpp
third_party/imgui/imgui_draw.cpp
third_party/imgui/imgui_tables.cpp
third_party/imgui/imgui_widgets.cpp
third_party/imgui/backends/imgui_impl_win32.cpp
third_party/imgui/backends/imgui_impl_dx11.cpp
)
set(LUA_SOURCES
third_party/lua/lapi.c third_party/lua/lauxlib.c third_party/lua/lbaselib.c
third_party/lua/lcode.c third_party/lua/lcorolib.c third_party/lua/lctype.c
third_party/lua/ldblib.c third_party/lua/ldebug.c third_party/lua/ldo.c
third_party/lua/ldump.c third_party/lua/lfunc.c third_party/lua/lgc.c
third_party/lua/linit.c third_party/lua/liolib.c third_party/lua/llex.c
third_party/lua/lmathlib.c third_party/lua/lmem.c third_party/lua/loadlib.c
third_party/lua/lobject.c third_party/lua/lopcodes.c third_party/lua/loslib.c
third_party/lua/lparser.c third_party/lua/lstate.c third_party/lua/lstring.c
third_party/lua/lstrlib.c third_party/lua/ltable.c third_party/lua/ltablib.c
third_party/lua/ltm.c third_party/lua/lundump.c third_party/lua/lutf8lib.c
third_party/lua/lvm.c third_party/lua/lzio.c
)
set(MINHOOK64_SOURCES
third_party/minhook/src/buffer.c
third_party/minhook/src/hook.c
third_party/minhook/src/trampoline.c
third_party/minhook/src/hde/hde64.c
)
add_library(SnowDesktopWorkshopImgui STATIC ${IMGUI_SOURCES})
target_compile_features(SnowDesktopWorkshopImgui PRIVATE cxx_std_20)
target_include_directories(SnowDesktopWorkshopImgui PUBLIC
third_party/imgui
third_party/imgui/backends
)
if(MSVC)
set_property(TARGET SnowDesktopWorkshopImgui PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopWorkshopImgui PRIVATE /MP${SNOWDESKTOP_COMPILE_JOBS} /W4 /permissive- /EHsc /utf-8 /Z7)
target_compile_definitions(SnowDesktopWorkshopImgui PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS)
endif()
add_library(SnowDesktopLua STATIC ${LUA_SOURCES})
set_source_files_properties(${LUA_SOURCES} PROPERTIES LANGUAGE C)
target_include_directories(SnowDesktopLua PUBLIC third_party/lua)
if(MSVC)
set_property(TARGET SnowDesktopLua PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopLua PRIVATE /MP${SNOWDESKTOP_COMPILE_JOBS}
/wd4244 /wd4310 /wd4324 /wd4701 /wd4702)
endif()
add_library(SnowDesktopEverything STATIC ${EVERYTHING_SOURCES})
set_source_files_properties(${EVERYTHING_SOURCES} PROPERTIES LANGUAGE C)
target_include_directories(SnowDesktopEverything PUBLIC
third_party/everything/include)
if(MSVC)
set_property(TARGET SnowDesktopEverything PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopEverything PRIVATE /MP${SNOWDESKTOP_COMPILE_JOBS} /wd4100 /wd4133 /wd4996)
endif()
add_library(SnowDesktopPinyinData STATIC ${PINYIN_DATA_SOURCES})
target_compile_features(SnowDesktopPinyinData PRIVATE cxx_std_20)
target_include_directories(SnowDesktopPinyinData PUBLIC
third_party/pinyin-data)
if(MSVC)
set_property(TARGET SnowDesktopPinyinData PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopPinyinData PRIVATE /MP${SNOWDESKTOP_COMPILE_JOBS})
endif()
if (MSVC)
cmake_host_system_information(RESULT WINDOWS_KITS_ROOT QUERY WINDOWS_REGISTRY
"HKLM/SOFTWARE/Microsoft/Windows Kits/Installed Roots"
VALUE "KitsRoot10" VIEW 32_64)
file(GLOB CPPWINRT_CANDIDATES
"${WINDOWS_KITS_ROOT}/bin/*/x64/cppwinrt.exe")
list(SORT CPPWINRT_CANDIDATES COMPARE NATURAL ORDER DESCENDING)
if (NOT CPPWINRT_CANDIDATES)
message(FATAL_ERROR "cppwinrt.exe was not found in the Windows 10/11 SDK")
endif()
list(GET CPPWINRT_CANDIDATES 0 CPPWINRT_EXECUTABLE)
get_filename_component(CPPWINRT_ARCH_DIR "${CPPWINRT_EXECUTABLE}" DIRECTORY)
set(MIDLRT_EXECUTABLE "${CPPWINRT_ARCH_DIR}/midlrt.exe")
if (NOT EXISTS "${MIDLRT_EXECUTABLE}")
message(FATAL_ERROR "midlrt.exe was not found next to cppwinrt.exe")
endif()
get_filename_component(CPPWINRT_VERSION_DIR "${CPPWINRT_ARCH_DIR}" DIRECTORY)
get_filename_component(CPPWINRT_SDK_VERSION "${CPPWINRT_VERSION_DIR}" NAME)
set(WINDOWS_WINMD
"${WINDOWS_KITS_ROOT}/UnionMetadata/${CPPWINRT_SDK_VERSION}/Windows.winmd")
if (NOT EXISTS "${WINDOWS_WINMD}")
message(FATAL_ERROR "Windows.winmd was not found for SDK ${CPPWINRT_SDK_VERSION}")
endif()
set(CPPWINRT_OUTPUT_DIR "${CMAKE_BINARY_DIR}/generated/cppwinrt")
set(SHELLVIEW_WINMD_DIR "${CMAKE_BINARY_DIR}/generated/winmd")
set(SHELLVIEW_WINMD "${SHELLVIEW_WINMD_DIR}/WindowsUdk.winmd")
file(TO_NATIVE_PATH
"${WINDOWS_KITS_ROOT}/Include/${CPPWINRT_SDK_VERSION}/winrt"
MIDLRT_INCLUDE_DIR)
file(TO_NATIVE_PATH
"${WINDOWS_KITS_ROOT}/UnionMetadata/${CPPWINRT_SDK_VERSION}"
MIDLRT_METADATA_DIR)
file(TO_NATIVE_PATH "${WINDOWS_WINMD}" MIDLRT_WINDOWS_WINMD)
file(TO_NATIVE_PATH "${SHELLVIEW_WINMD_DIR}" MIDLRT_OUTPUT_DIR)
add_custom_command(
OUTPUT "${SHELLVIEW_WINMD}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${SHELLVIEW_WINMD_DIR}"
COMMAND "${MIDLRT_EXECUTABLE}"
/winrt /nomidl /no_cpp
/I "${MIDLRT_INCLUDE_DIR}"
/metadata_dir "${MIDLRT_METADATA_DIR}"
/reference "${MIDLRT_WINDOWS_WINMD}"
/out "${MIDLRT_OUTPUT_DIR}"
/winmd WindowsUdk.winmd
"ShellViewCoordinator.idl"
DEPENDS
"${CMAKE_SOURCE_DIR}/src/taskbar_dynamic/ShellViewCoordinator.idl"
"${WINDOWS_WINMD}"
COMMENT "Compiling the ShellViewCoordinator WinMD..."
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src/taskbar_dynamic"
VERBATIM)
add_custom_command(
OUTPUT
"${CPPWINRT_OUTPUT_DIR}/winrt/base.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.ApplicationModel.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.Foundation.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.UI.Xaml.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.UI.Xaml.Shapes.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/WindowsUdk.UI.Shell.h"
COMMAND "${CPPWINRT_EXECUTABLE}"
-in "${WINDOWS_WINMD}"
-in "${SHELLVIEW_WINMD}"
-out "${CPPWINRT_OUTPUT_DIR}"
DEPENDS "${WINDOWS_WINMD}" "${SHELLVIEW_WINMD}"
COMMENT "Generating C++/WinRT projections for the taskbar XAML hook..."
VERBATIM)
add_custom_target(SnowDesktopCppWinRT DEPENDS
"${CPPWINRT_OUTPUT_DIR}/winrt/base.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.ApplicationModel.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.Foundation.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.UI.Xaml.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/Windows.UI.Xaml.Shapes.h"
"${CPPWINRT_OUTPUT_DIR}/winrt/WindowsUdk.UI.Shell.h")
add_library(SnowDesktopTaskbarHook SHARED
src/taskbar_hook/taskbar_hook.cpp
src/taskbar_hook/tray_collector.cpp
src/taskbar_hook/tray_protocol.h
src/taskbar_hook/taskbar_native.cpp
src/taskbar_hook/taskbar_classic_surface.cpp
src/taskbar_hook/taskbar_hook_protocol.h
src/taskbar_hook/taskbar_autohide_observer.cpp
src/taskbar_hook/taskbar_autohide_observer.h
src/taskbar_hook/taskbar_autohide_trace.h
src/taskbar_hook/taskbar_autohide_rules.h
${MINHOOK64_SOURCES}
src/taskbar_hook/taskview_visibility.h
src/taskbar_hook/taskbar_hook.def
"${SNOWDESKTOP_TASKBAR_HOOK_VERSION_RESOURCE}"
)
add_dependencies(SnowDesktopTaskbarHook SnowDesktopCppWinRT)
set_target_properties(SnowDesktopTaskbarHook PROPERTIES
OUTPUT_NAME "SnowDesktopTaskbarHook")
target_compile_features(SnowDesktopTaskbarHook PRIVATE cxx_std_20)
target_include_directories(SnowDesktopTaskbarHook PRIVATE
src
src/taskbar_hook
third_party/minhook/include
"${CPPWINRT_OUTPUT_DIR}"
)
target_compile_definitions(SnowDesktopTaskbarHook PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS
WINVER=0x0A00 _WIN32_WINNT=0x0A00 WINRT_NO_MODULE_LOCK)
target_link_libraries(SnowDesktopTaskbarHook PRIVATE
advapi32 comctl32 d2d1 d3d11 dcomp dwmapi dxgi dxguid gdi32 ole32 runtimeobject shell32 user32 windowsapp)
set_property(TARGET SnowDesktopTaskbarHook PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopTaskbarHook PRIVATE
/W4 /permissive- /EHsc /utf-8)
# Keep the legacy Windows.UI.Xaml/ShellView projection out of the main
# WinUI 3 executable. The Windows SDK currently ships a different
# C++/WinRT generator version than the pinned NuGet package, and mixing
# their generated headers in one translation unit is rejected by
# C++/WinRT. This narrow library has a standard C++ public boundary and
# may therefore continue using the hook projection independently.
add_library(SnowDesktopSearchVisibility STATIC
src/taskbar_dynamic/search_visibility_detector.cpp
src/taskbar_dynamic/search_visibility_detector.h)
add_dependencies(SnowDesktopSearchVisibility SnowDesktopCppWinRT)
set_property(TARGET SnowDesktopSearchVisibility PROPERTY
VS_PACKAGE_REFERENCES
"Microsoft.Windows.CppWinRT_${SNOWDESKTOP_CPPWINRT_PACKAGE_VERSION}")
set_property(TARGET SnowDesktopSearchVisibility PROPERTY VS_USER_PROPS
"${CMAKE_SOURCE_DIR}/cmake/SnowDesktop.ShellView.props")
set_property(TARGET SnowDesktopSearchVisibility PROPERTY
VS_GLOBAL_SnowDesktopCppWinRtPackageVersion
"${SNOWDESKTOP_CPPWINRT_PACKAGE_VERSION}")
target_compile_features(SnowDesktopSearchVisibility PRIVATE cxx_std_20)
target_include_directories(SnowDesktopSearchVisibility PRIVATE
src/taskbar_dynamic
"${CMAKE_BINARY_DIR}/generated/shellview-cppwinrt")
target_compile_definitions(SnowDesktopSearchVisibility PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN
_CRT_SECURE_NO_WARNINGS WINVER=0x0A00 _WIN32_WINNT=0x0A00)
target_link_libraries(SnowDesktopSearchVisibility PRIVATE
ole32 runtimeobject windowsapp)
set_property(TARGET SnowDesktopSearchVisibility PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopSearchVisibility PRIVATE
/W4 /permissive- /EHsc /utf-8)
add_library(SnowDesktopWallpaperHook SHARED
src/wallpaper_hook/wallpaper_hook.cpp
src/wallpaper_hook/wallpaper_hook_protocol.h
${MINHOOK64_SOURCES}
)
target_compile_features(SnowDesktopWallpaperHook PRIVATE cxx_std_20)
target_include_directories(SnowDesktopWallpaperHook PRIVATE
src/wallpaper_hook
third_party/minhook/include
third_party/minhook/src
third_party/minhook/src/hde
)
target_compile_definitions(SnowDesktopWallpaperHook PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN
_CRT_SECURE_NO_WARNINGS WINVER=0x0A00 _WIN32_WINNT=0x0A00)
target_link_libraries(SnowDesktopWallpaperHook PRIVATE
d3d9 d3d11 dxgi user32)
set_property(TARGET SnowDesktopWallpaperHook PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopWallpaperHook PRIVATE
/W4 /permissive- /EHsc /utf-8)
set_source_files_properties(${MINHOOK64_SOURCES} PROPERTIES
COMPILE_OPTIONS
"/wd4100;/wd4201;/wd4244;/wd4267;/wd4310;/wd4701")
endif()
set_source_files_properties(src/winui/App.xaml PROPERTIES
VS_XAML_TYPE "ApplicationDefinition")
set_source_files_properties(
src/resources/resource.rc
src/resources/app_icon.rc
PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/src/resources")
set_source_files_properties(src/winui/SettingsShell.xaml PROPERTIES
VS_XAML_TYPE "Page")
set_source_files_properties(
src/winui/App.idl
src/winui/App.xaml.cpp
src/winui/App.xaml.h
PROPERTIES
VS_SETTINGS "DependentUpon=App.xaml;SubType=Code")
set_source_files_properties(
src/winui/SettingsShell.xaml.cpp
src/winui/SettingsShell.xaml.h
PROPERTIES
VS_SETTINGS "DependentUpon=SettingsShell.xaml;SubType=Code")
# CMake merges .manifest target sources with the linker/Windows App SDK
# manifests. Opt in only native HWND hosts and their matching preview tests;
# preserve generated UAC, WinRT activation and common-controls declarations.
function(snowdesktop_enable_native_window_compatibility TARGET_NAME)
target_sources(${TARGET_NAME} PRIVATE
"${CMAKE_SOURCE_DIR}/cmake/native_windows_compatibility.manifest")
endfunction()
add_executable(SnowDesktop WIN32
${SNOWDESKTOP_SOURCES}
src/resources/resource.rc
"${SNOWDESKTOP_EXE_VERSION_RESOURCE}"
)
source_group(TREE "${CMAKE_SOURCE_DIR}/src" PREFIX "Source" FILES
${SNOWDESKTOP_SOURCES}
src/resources/resource.rc)
snowdesktop_enable_native_window_compatibility(SnowDesktop)
# Error messages must survive a missing or damaged distribution/lang tree.
# Keep lang/*.json as the only translation source, embedded at configure time.
file(GLOB SNOWDESKTOP_LAUNCHER_CATALOGS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/lang/*.json")
set(SNOWDESKTOP_LAUNCHER_MESSAGES "#pragma once\nstruct LauncherMessage { const char* language; const wchar_t* message; const wchar_t* pending; const wchar_t* warning; const wchar_t* startup; const wchar_t* securitySoftwareHint; };\ninline constexpr LauncherMessage kLauncherMessages[] = {\n")
foreach(catalog IN LISTS SNOWDESKTOP_LAUNCHER_CATALOGS)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${catalog}")
get_filename_component(language "${catalog}" NAME_WE)
file(READ "${catalog}" catalog_json)
string(JSON message GET "${catalog_json}" "app.launcher.failed")
string(JSON pending GET "${catalog_json}" "app.launcher.pending")
string(JSON warning GET "${catalog_json}" "app.launcher.warning")
string(JSON startup GET "${catalog_json}" "app.operation.startFailed")
string(JSON security_hint GET "${catalog_json}" "app.launcher.securitySoftwareHint")
string(APPEND SNOWDESKTOP_LAUNCHER_MESSAGES "{\"${language}\", LR\"LAUNCHER(${message})LAUNCHER\", LR\"LAUNCHER(${pending})LAUNCHER\", LR\"LAUNCHER(${warning})LAUNCHER\", LR\"LAUNCHER(${startup})LAUNCHER\", LR\"LAUNCHER(${security_hint})LAUNCHER\"},\n")
endforeach()
string(APPEND SNOWDESKTOP_LAUNCHER_MESSAGES "};\n")
file(CONFIGURE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/launcher_messages.h"
CONTENT "${SNOWDESKTOP_LAUNCHER_MESSAGES}" @ONLY)
add_executable(SnowDesktopLauncher WIN32
src/steam/steam_launcher_main.cpp
src/steam/steam_runtime_context.cpp
src/steam/steam_runtime_manager.cpp
src/steam/steam_runtime_manager.h
src/steam/steam_runtime_context.h
src/resources/app_icon.rc
"${SNOWDESKTOP_LAUNCHER_VERSION_RESOURCE}")
target_compile_features(SnowDesktopLauncher PRIVATE cxx_std_20)
target_include_directories(SnowDesktopLauncher PRIVATE src "${CMAKE_CURRENT_BINARY_DIR}/generated")
target_link_libraries(SnowDesktopLauncher PRIVATE bcrypt shell32 user32)
if (MSVC)
set_property(TARGET SnowDesktopLauncher PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktopLauncher PRIVATE
/W4 /permissive- /EHsc /utf-8)
target_compile_definitions(SnowDesktopLauncher PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN)
else()
target_compile_options(SnowDesktopLauncher PRIVATE
-Wall -Wextra -pedantic)
target_compile_definitions(SnowDesktopLauncher PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN)
endif()
# Pin the complete WinUI toolchain on the executable so NuGet restore,
# C++/WinRT projection generation, XAML compilation, and self-contained
# deployment all happen in the CMake-generated MSBuild project.
set_property(TARGET SnowDesktop PROPERTY VS_PACKAGE_REFERENCES
"Microsoft.WindowsAppSDK_${SNOWDESKTOP_WINDOWSAPPSDK_PACKAGE_VERSION};Microsoft.Windows.CppWinRT_${SNOWDESKTOP_CPPWINRT_PACKAGE_VERSION}")
set_property(TARGET SnowDesktop PROPERTY VS_USER_PROPS
"${CMAKE_SOURCE_DIR}/cmake/SnowDesktop.WinUI.props")
set_property(TARGET SnowDesktop PROPERTY
VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION "10.0.19041.0")
set_target_properties(SnowDesktop PROPERTIES
VS_GLOBAL_ROOTNAMESPACE "SnowDesktop"
VS_GLOBAL_SnowDesktopSourceDirectory "${CMAKE_SOURCE_DIR}"
VS_GLOBAL_SnowDesktopWindowsAppSdkPackageVersion
"${SNOWDESKTOP_WINDOWSAPPSDK_PACKAGE_VERSION}"
VS_GLOBAL_SnowDesktopCppWinRtPackageVersion
"${SNOWDESKTOP_CPPWINRT_PACKAGE_VERSION}"
VS_GLOBAL_AppContainerApplication "false"
VS_GLOBAL_AppxPackage "false"
VS_GLOBAL_CppWinRTOptimized "true"
VS_GLOBAL_CppWinRTRootNamespaceAutoMerge "true"
VS_GLOBAL_EnablePreviewMsixTooling "false"
# C++/WinRT's MSBuild targets concatenate this value with ProjectDir in
# several places, so it must remain project-relative.
VS_GLOBAL_GeneratedFilesDir "generated\\winui\\$(Configuration)\\"
VS_GLOBAL_TargetPlatformMinVersion "10.0.19041.0"
VS_GLOBAL_TargetPlatformVersion "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}"
VS_GLOBAL_UseCrtSDKReferenceStaticWarning "false"
VS_GLOBAL_UseWinUI "true"
VS_GLOBAL_WindowsAppSDKSelfContained "true"
VS_GLOBAL_WindowsAppSdkUndockedRegFreeWinRTInitialize "true"
VS_GLOBAL_WindowsPackageType "None")
if (TARGET SnowDesktopTaskbarHook)
add_dependencies(SnowDesktop SnowDesktopTaskbarHook)
endif()
if (TARGET SnowDesktopWallpaperHook)
add_dependencies(SnowDesktop SnowDesktopWallpaperHook)
target_compile_definitions(SnowDesktop PRIVATE
SNOWDESKTOP_ENABLE_WALLPAPER_ENGINE_CAPTURE=1)
endif()
target_compile_features(SnowDesktop PRIVATE cxx_std_20)
target_include_directories(SnowDesktop PRIVATE
src
"${CMAKE_BINARY_DIR}/generated"
src/core
src/app
src/winui
"${CMAKE_BINARY_DIR}/generated/xaml/$<CONFIG>"
)
if (MSVC)
set_property(TARGET SnowDesktop PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_compile_options(SnowDesktop PRIVATE /MP${SNOWDESKTOP_COMPILE_JOBS} /bigobj /W4 /permissive- /EHsc /utf-8 /Z7)
target_compile_definitions(SnowDesktop PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS
WINVER=0x0A00 _WIN32_WINNT=0x0A00
DISABLE_XAML_GENERATED_MAIN
SNOWDESKTOP_VERSION="${SNOWDESKTOP_VERSION}"
SNOWDESKTOP_STEAM_APP_ID=${SNOWDESKTOP_STEAM_APP_ID}
SNOWDESKTOP_STORE_ID="${SNOWDESKTOP_STORE_ID}"
SNOWDESKTOP_PACKAGE_FAMILY_NAME="${SNOWDESKTOP_PACKAGE_FAMILY_NAME}")
target_precompile_headers(SnowDesktop PRIVATE
<windows.h>
<shlwapi.h>
<shlobj.h>
<shellapi.h>
<d2d1_1.h>
<wrl/client.h>
<algorithm>
<atomic>
<cmath>
<cstdint>
<fstream>
<functional>
<memory>
<mutex>
<sstream>
<string>
<thread>
<unordered_map>
<unordered_set>
<vector>
)
target_link_options(SnowDesktop PRIVATE
"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
/DELAYLOAD:Microsoft.UI.Windowing.Core.dll
/DEBUG:FULL /INCREMENTAL:NO /OPT:REF /OPT:ICF)
else()
target_compile_options(SnowDesktop PRIVATE -Wall -Wextra -pedantic)
target_compile_definitions(SnowDesktop PRIVATE
_UNICODE UNICODE NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS
SNOWDESKTOP_VERSION="${SNOWDESKTOP_VERSION}"
SNOWDESKTOP_STEAM_APP_ID=${SNOWDESKTOP_STEAM_APP_ID}
SNOWDESKTOP_STORE_ID="${SNOWDESKTOP_STORE_ID}"
SNOWDESKTOP_PACKAGE_FAMILY_NAME="${SNOWDESKTOP_PACKAGE_FAMILY_NAME}")
endif()
target_link_libraries(SnowDesktop PRIVATE
${SNOWDESKTOP_SYSTEM_CONTROL_LIBRARIES}
SnowDesktopLua SnowDesktopEverything SnowDesktopPinyinData
SnowDesktopSearchVisibility
comctl32 d2d1 d3d11 dbghelp dcomp dwmapi dwrite dxgi dxguid gdi32 msimg32
advapi32 bcrypt crypt32 delayimp imm32 iphlpapi ole32 oleacc oleaut32 pdh propsys runtimeobject shcore shell32 shlwapi uiautomationcore urlmon user32 windowsapp windowscodecs uuid winhttp ws2_32 xmllite
version wbemuuid taskschd
)
add_custom_command(TARGET SnowDesktop POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/widgets"
"$<TARGET_FILE_DIR:SnowDesktop>/widgets"
COMMENT "Copying widget scripts to output (SnowDesktop)..."
)
add_custom_command(TARGET SnowDesktop POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/lang"
"$<TARGET_FILE_DIR:SnowDesktop>/lang"
COMMENT "Copying language files to output (SnowDesktop)..."
)
set(SNOWDESKTOP_WIDGET_SKILL_MANIFEST
"${CMAKE_SOURCE_DIR}/widgets/snowdesktop-lua-widget/skill.json")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
"${SNOWDESKTOP_WIDGET_SKILL_MANIFEST}")
file(READ "${SNOWDESKTOP_WIDGET_SKILL_MANIFEST}"
SNOWDESKTOP_WIDGET_SKILL_MANIFEST_JSON)
string(JSON SNOWDESKTOP_WIDGET_SKILL_REVISION GET
"${SNOWDESKTOP_WIDGET_SKILL_MANIFEST_JSON}" revision)