Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
694 views
in Technique[技术] by (71.8m points)

visual studio - How to have global settings defined in a solution in VC++?

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...