Skip to content

.NET SDK Style Projects Improvements

Florian Schweiger requested to merge Husker/cmake:dotnet_sdk into sumitb/dotnet_sdk

Since you've took over the CMake .NET SDK project extension - which I really appreciate, I want to provide some patches for various issues. The first commit was the Any CPU target issue I've told you in your original merge request. So I just added it for completeness reasons. The second commit adds the ability to change the output directory for binaries. This was not possible with your original code.

And finally the last (and biggest) commit which enables CMake to build mixed architecture projects. Here the use case is a build command to a multi project solution (C/C++ x86 build targets and a new .NET SDK project with Any CPU):

cmake -S C:\pathToProject -A Win32

The solution has a Win32 target which maps to Any CPU for .NET SDK projects after generation. All fine until it comes to build call:

cmake --build C:\pathToGeneratedProjectDirectory --config Debug --target projectName -- -verbosity:minimal

This targets the Debug configuration, but it uses the default Win32 platform specifier. Result is that the build command tries to build the .NET SDK project with Debug|Win32. My patch extends the Visual Studio solution parser and uses its mapping information to select the correct platform specifier Any CPU.

Merge request reports