CSharp: Can't export or import C# libraries correctly
I stumbled upon this issue when trying to use something along the lines
add_library(CsLibrary SHARED CsFile.cs)
install(TARGETS CsLibrary EXPORT CsLibraryTarget)
install(EXPORT CsLibraryTarget DESTINATION ${some_dir} FILE CsLibraryConfig.cmake)
The now generated {some_dir}/CsLibraryConfig-
.cmake file is not generated correctly. It is handled like a SHARED C++ library and sets the property IMPORTED_IMPLIB_$ and also appends the nonexistent CsLibrary.lib to the _IMPORT_CHECK_FILES_FOR_CsLibrary list.
C# libraries don't generate any import .lib files so this obviously can't work. I tried to fix this, but then quickly realized that I'm not even sure if it's currently at all possible to generate an imported C# library target.
I know I can use the property VS_DOTNET_REFERENCE_CsLibrary on targets that need to use CsLibrary, but what I would like to do is to generate an imported C# library target which can be consumed by C++ libraries (just like it works when I add the library as part of the build process).
From my point of view some kind of property (heck it could even be IMPORTED_IMPLIB_$) that points to the CsLibrary.dll would have to be checked by targets that link against C# libraries and it would result in an added VS_DOTNET_REFERENCE_CsLibrary property on that target (or it's getting interpreted by the Visual Studio Generator directly).
I would be willing to contribute to get this fixed, but would like to know which your preferred solution is.