CSharp: build error when using C# target with to high target framework version
Building a project with cmake --build .
fails for C#
targets if the target framework version of the C#
targets is too high. There is a error message like this:
Project XXXX targets 'net461'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.0'.
Adding a <TargetFrameworkVersion>
tag to ALL_BUILD
with the correct version fixes the problem.
Proposal: add a CMAKE_TARGET_FRAMEWORK_VERSION
variable analog to the VS_TARGET_FRAMEWORK_VERSION
target property which sets framework version default and adds the tag to the ALL_BUILD
target (if set/defined).