[feature] Support c++/WinRT idl & xaml files.
CMake latest can easily generate command-line c++/WinRT projects. However, it cannot easily do so with c++/WinRT UI.
Add a VS_CPPWINRT_COMPONENT
or equivalent flag to generate c++/WinRT projects without errors.
One of the main blockers is adding the idl & xaml files as if it were a c++/CX project. Currently, in vcproj, they are added as
<!-- This must be changed -->
<Midl Include="App.idl" />
<Midl Include="MainPage.idl" />
<!-- This must be removed -->
<Midl>
<AdditionalIncludeDirectories>src_gui;include;libinclude;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
<HeaderFileName>%(Filename).h</HeaderFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
</Midl>
The larger entries need to be removed, and the idl files must be added as such:
<ItemGroup>
<Midl Include="App.idl">
<DependentUpon>App.xaml</DependentUpon>
</Midl>
<Midl Include="MainPage.idl">
<DependentUpon>MainPage.xaml</DependentUpon>
</Midl>
</ItemGroup>
As far as I can tell, a lot of the required properties and steps are already supported. You can use VS_PACKAGE_REFERENCES
for nuget. Use a props file to silence warnings. Add your resources using existing properties. Set VS_GLOBAL_ROOTNAMESPACE
etc. But the Midl is problematic.