Visual c ++ 2008:如何在解决方案中定义全局设置 [英] Visual c++ 2008: how to have global settings defined in a solution

查看:145
本文介绍了Visual c ++ 2008:如何在解决方案中定义全局设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有许多解决方案,其中有大量的项目。我想要能够定义所有项目使用的解决方案的全局设置。例如include目录。我想能够在一个地方为解决方案中的所有项目更改包含目录。

I have a number of solutions with a large number of projects in them. I would like to be able to define global settings for the solution that are used by all projects. For example an include directory. I want to be able to change the include directory in one place for all projects in the solutions.

当我搜索解决方案时,我发现了一个很好的描述匹配我确切地,但解决方案建议那里,项目属性表,每个项目而不是每个解决方案。

When I searched for a solution I found a good description of the problem that matches mine exactly but the solution suggested there, project property sheets, are defined per project and not per solutions.

我可以使用环境变量或Visual studio设置,但是需要编译代码的每个人都必须定义完全相同的设置。

I could use environment variables or Visual studio settings, but then everyone that needs to compile the code has to define the exact same settings.

任何人都可以建议一种方法吗?感谢。

Can anyone suggest a way to do this? Thanks.

推荐答案

我们使用属性表来完成此操作。单个属性表可以分配给解决方案中的所有项目。

We use property sheets to accomplish this. A single property sheet can be assigned to all the projects in the solution. From then on you can change a setting in that one property sheet and it will affect all the projects.

高级提示:我们实际上使用了多个属性表(例如,一个用于释放目标类型,一个用于调试目标类型)。提示是,顺序是非常重要的。如果您手动编辑项目文件,则最后一个属性表将覆盖列表中上一个属性表中的设置。如果你在GUI中编辑,那么TOP一个覆盖它下面的。

Advanced tip: We actually use multiple property sheets, (e.g. one for release target types, one for debug target types). The tip is that the order is very important. If you're editing the project files by hand then the last property sheet will override settings in the previous property sheets in the list. If you're editing in the GUI, then the TOP one overrides the ones below it.

这篇关于Visual c ++ 2008:如何在解决方案中定义全局设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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