CMake的VS_PACKAGE_REFERENCES未添加对VS2017项目的引用 [英] CMake's VS_PACKAGE_REFERENCES not adding a reference to VS2017 project

查看:50
本文介绍了CMake的VS_PACKAGE_REFERENCES未添加对VS2017项目的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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.

推荐答案

嗯,根据

针对整个.NET Framework的ASP.NET应用仅包括有限的支持PackageReference. C ++和JavaScript项目类型为不支持.

这使得CMake的整个 VS_PACKAGE_REFERENCES 选项不适用于C ++项目.

This makes the whole VS_PACKAGE_REFERENCES option from CMake inapplicable for C++ projects.

这篇关于CMake的VS_PACKAGE_REFERENCES未添加对VS2017项目的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆