Visual C++ IDE from the trenches
my last entry talked about the files that are contained in a project. this entry is going to discuss the next important collection of items in the project: the configurations.
a configuration is really nothing more than a collection of property values. for instance, in a "debug" configuration the "optimization" property on the C++ compiler tool is usually set to "disabled" (/Od), while in a "release" configuration it is usually set to something like "maximize speed" (/O2). because they control what is built, and how, they are often likened to a "target" in a makefile, although they are not exactly the same.
when you bring up the project properties dialog, the configuration that you are actually manipulating is shown in the upper left in a combo-box control. you can change the configuration and see that the property values below change. you can also select "all configurations" to set properties on all of the configurations simultaneously, but this has one potential danger: any property that is different in different configurations will show as blank. it is easy to accidentally enter a value in a blank property and overwrite that value on all the configurations. (this is particularly insidious with things like the c++ compiler's "preprocessor definitions" property, which consists of a list of strings that is quite often different across configurations. if you type into the blank field and apply the change you have not added new preprocessor definitions to all the configs, like you might think, but have instead replaced all of them with what you just typed).
when browsing through the pages in the property pages dialog one thing you might notice is that some properties are shown in a bold font while others are not. the bold font indicates that the property in question has overridden the value of the property. in other words, if the property value is not bold, the property is in its default state and has not been set.
a project can contain any number of configurations. the VC application wizards generate only two by default, debug and release, but you can add any number of them. for maintainabilities' sake I recommend only creating as many as you actually need. many things that you might be tempted to create a new configuration for can actually be better handled by using project system macros. which is exactly what i'll be discussing in my next entry...
Anonymous comments are disabled