CMake scripts for building WinUI 3 apps.
Useful if you want to build a a WinUI 3 app with CMake and not necessarily use the Visual Studio generator.
Provides the following functionality:
- Run
nuget install
, get package directories - Locate Windows 10 SDK & relevant files within
- Generate
.winmd
files usingmidl
- Merge
.winmd
files usingmdmerge
- Generate headers using
cppwinrt
- Create
.pri
files - Compile
.xaml
files using standaloneXamlCompiler.exe
The standalone XamlCompiler.exe
has broken error reporting (see microsoft/microsoft-ui-xaml#10027),
making troubleshooting failures quite hard.
Apparently the only officially supported way to run the XAML compiler is through MSBuild; so a possible approach to get run it in a supported fashion could be to generate a wrapper MSBuild project to run it.
Shout out to GitHub user DarranRowe who shared his own experience with running the standalone XamlCompiler, making it vastly easier for me to build the required CMake logic.