CMake的VS_PACKAGE_REFERENCES未添加对VS2017项目的引用 [英] CMake's VS_PACKAGE_REFERENCES not adding a reference to VS2017 project
问题描述
我正在尝试使用CMake自动向我的(C ++)Visual Studio 2017项目添加(nuget)引用.
I'm trying to automatically add (nuget) references to my (C++) visual studio 2017 project using CMake.
在此问题中,建议 VS_PACKAGE_REFERENCES
,可从CMAKE 3.15.因此,我在CMAKE代码中添加了以下内容:
In this question, VS_PACKAGE_REFERENCES
is suggested, available from CMAKE 3.15. So, I've added the following to my CMAKE code:
set_property(TARGET MyApplication
PROPERTY VS_PACKAGE_REFERENCES "BaseUtils.Native.Dynamic_0.4.0.38060"
)
以下内容很好地添加到了我的项目中:
And the following is nicely added to my project:
<ItemGroup>
<PackageReference Include="BaseUtils.Native.Dynamic" Version="0.4.0.38060" />
</ItemGroup>
但是,参考没有显示在解决方案资源管理器中,也没有任何包含文件夹添加到项目中.似乎没有考虑到 PackageReference
元素.
However, the reference is not show in the solution explorer, nor are any include folders added to the project. It seems that the PackageReference
element is in no way taken into account.
有人知道如何解决这个问题吗?我正在使用CMake 3.15.3,它没有给出任何错误或警告.
Anyone any idea how to solve this? I'm using CMake 3.15.3, which doesn't give any errors or warnings.