Replies: 8 comments
-
Nope, microsoft/cppwinrt#1080 |
Beta Was this translation helpful? Give feedback.
-
It is - but if you want to use anything that takes a winrt::xaml_type (e.g. Frame.Navigate instead of setting content), you need to implement xamlmetadataprovider yourself. Example using Content: https://github.com/fredemmott/cmake-cpp-winrt-winui3 In a real world hobby project, i've integrated a winui frontend in a mostly cmake project by making cmake call msbuild, but this is nasty: https://github.com/fredemmott/OpenKneeboard/blob/3446befb5c587d60c7c18521f9bf7b42d33a46e5/src/app/app-winui3/CMakeLists.txt + https://github.com/fredemmott/OpenKneeboard/blob/3446befb5c587d60c7c18521f9bf7b42d33a46e5/src/app/app-winui3/app-winui3.vcxproj
I don't know about plans; as a user, the ideal solution would be for Microsoft to split the xaml compiler out to a separate executable again, then it could be consistently integrated with any build system. CMake could be altered to support |
Beta Was this translation helpful? Give feedback.
-
That kind of manual workarounds is anything but "supported". |
Beta Was this translation helpful? Give feedback.
-
Agreed, but “possible” |
Beta Was this translation helpful? Give feedback.
-
It is possible, but not supported, as fredemmott points out. @RealTommyKlein or @evelynwu-msft might be able to share more specifics. |
Beta Was this translation helpful? Give feedback.
-
It isn't possible right now due to a reliance on build tasks only available via MSBuild. There is an executable version of the Xaml compiler which is planned to ship in Windows App SDK 1.2, but its inputs handled via JSON are also generated via MSBuild - CMake could also generate those input JSONs though. However other MSBuild tasks, like packaging/resource generation, may also need to be ported to an executable form for the scenario to work end to end. |
Beta Was this translation helpful? Give feedback.
-
I have a mixed cmake/msbuild project (msbuild entirely due to winui3) - admittedly it's a small project, but I've not had any problems with msix packaging or makepri etc from the cmake, if that's what you're referring to |
Beta Was this translation helpful? Give feedback.
-
With CMake 3.23 (April 2022) and Windows App SDK 1.1 (June 2022), it's possible to build unpackaged self-contained WinUI3 apps with Xaml, with CMake: I've updated https://github.com/fredemmott/cmake-cpp-winrt-winui3 to show this I've posted issues/areas for improvement at #3863 (comment) |
Beta Was this translation helpful? Give feedback.
-
Is it already possible to use CMake to build C++ WinUI3 apps?
If it is, where can i find an example.
And if not is this on microsofts todo list or will it be left as a todo for the cmake project volunteers?
Beta Was this translation helpful? Give feedback.
All reactions