在 VS 2010 中继承 C++ 项目属性 [英] Inheriting C++ project properties in VS 2010

查看:48
本文介绍了在 VS 2010 中继承 C++ 项目属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS2010 中有一个 C++ 项目.我希望另一个 C++ 项目继承其属性(例如,包括目录、外部库等).似乎最好的方法是使用属性表,但我不知道该怎么做.

I have a C++ project in VS2010. I would like another C++ project to inherit its properties (e.g. include directories, external libraries, etc.). It seems the best way to do this is to use Property Sheets, but I can't figure out how to do it.

当我尝试将现有的属性表添加到新项目时,我希望能够在旧项目的目录中找到包含旧项目属性的属性表.不存在这样的文件.

When I try adding an existing property sheet to my new project, I expect to be able to find a property sheet containing the old project's properties in the old project's directory. No such file exists.

我该怎么办?

推荐答案

为了创建可继承的属性,您必须创建一个新的属性表,将其保存在本地位置,并让您希望使用这些属性的任何项目(继承) 它通过添加现有"表.

In order to create inheritable properties you must create a new property sheet, save it in a local location and have any projects you want to have those properties use (inherit) it by "Add Existing" sheet.

属性表的列出顺序很重要.如果该属性被列为使用默认值或从父级继承",它将从其正下方的属性表中获取值,如果其下方没有属性表,则将使用默认值.

The order of the listing of property sheets matters. If the property is listed as "Use default or inherit from parent" it will get the value from the property sheet directly below it or if there is none below it, it will use the default.

属性表管理器中列出的表只是链接.如果文件链接到多个配置并且您将其更改为一个,则所有链接的配置都将接受更改.因此,如果您想对每个 Config 进行不同的更改.对于相同的属性,您必须制作单独的表格.

The sheets listed in the property sheet manager are just links. If the file is linked to multiple Configurations and you change it in one, ALL linked configurations will accept the changes. Therefore if you want to make different changes for each Config. for the same property you must make separate sheets.

这篇关于在 VS 2010 中继承 C++ 项目属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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