Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 336
Dani van der Meer Avatar asked Dec 18 '08 06:12

Dani van der Meer


1 Answers

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.

like image 131
Stephen W. Carson Avatar answered Nov 15 '22 23:11

Stephen W. Carson