Hello,

we're looking into generating our C# projects using CMAKE. We can generate 
working solution files, but we're still struggling with dependencies. We would 
like to manage nuget packages via the nuget.exe command line tool. With the 
install or restore parameter this deems us a good approach for managing 
dependencies. However, CMAKE currently only supports the Reference tag in the 
csproj file. Without an additional HintPath subtag into the package's folder 
the reference is not resolved. This HintPath points down the whole path to the 
DLL of the package, including version etc. So far I have not found a way how to 
extract this path from nuget.exe and I would not like having to guess it to 
fill the HintPath tag.

Any ideas how to solve this issue?

We found that using the new PackageReference tag (new since VS2017) would work 
fine without a HintPath and would offer complete configuration of dependencies 
via nuget.

So we wondered if CMAKE could support this new PackageReference tag, too, like 
it does for the Reference tag by means of the VS_DOTNET_REFERENCES? Or is there 
any way how we could inject the XML into the generated csproj file ourselves 
from the project's CMakeLists.txt? Looking into the CMAKE source code, I think 
supporting the PackageReference tag would basically require going along the 
lines of the VS_DOTNET_REFERENCES property handling. However, I don't know if 
another property like this (e.g. VS_DOTNET_PACKAGEREFERENCES) would be 
appreciated by the CMAKE team or whether there are better solutions? If such a 
property were acceptable maybe we could even try to offer a patch for CMAKE.

Thank you!

Cheers,
Jörn



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to