CMake C# WPF outputType is "Exe", this is console application

Hi,

I have a CMake project with C# and C++ targets.

It’s similar to this example here:

If you change the .net framework to 4.8 by adding this before the WPF executable is added:
set(CMAKE_DOTNET_SDK “Microsoft.NET.Sdk”)
set(CMAKE_DOTNET_TARGET_FRAMEWORK “net48”)

Then the OutputType changes to “Exe”.
In Visual Studio this is a Console Application.

I need OutputType to be WinExe instead. How do I achieve this?

Adding this:
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_OutputType “WinExe”)

Doesn’t help. It adds a second entry to the project.
Adding WIN32 to add_executable doesn’t help either.

How should I fix this?

Thanks!

Emiel

It seems this issue was fixed in a nightly build.