$(..)
values are called macros. A macro is a compile-time constant that can refer to a value that is defined by Visual Studio or the MSBuild system, or to a user-defined value. By using macros instead of hard-coded values such as directory paths, you can more easily share property settings between machines and between versions of Visual Studio, and you can better ensure that your project settings participate correctly in property inheritance.$(name)
. An example of a global macro is $(VCInstallDir)
, which stores the root directory of your Visual Studio installation. A global macro corresponds to a PropertyGroup
in MSBuild.%(name)
. For a file, an item macro applies only to that file—for example, you can use %(AdditionalIncludeDirectories)
to specify include directories that apply only to a particular file. This kind of item macro corresponds to an ItemGroup
metadata in MSBuild. When it's used in the context of a project configuration, an item macro applies to all files of a certain type. For example, the C/C++ Preprocessor Definitions configuration property can take a %(PreprocessorDefinitions)
item macro that applies to all .cpp files in the project. This kind of item macro corresponds to an ItemDefinitionGroup
metadata in MSBuild. For more information, see Item Definitions.