Bagikan melalui


Property Sheets (C+)

A project property sheet is an .xml file with the extension .vsprops. It enables you to specify switches for build tools such as the compiler or linker and create user-defined macros.

You can use property sheets to create project configurations that can be applied to multiple projects since project settings that are defined in .vsprops files are inheritable, unlike project settings defined in Project Files (.vcproj files). Therefore, a project configuration defined in a .vcproj file can inherit project settings from one or more property sheets (.vsprops files). For more information, see Property Inheritance.

For information on tasks that demonstrate this concept, see:

Example

The following .vsprops file contains both build tool properties and user-defined macros.

<?xml version="1.0" ?>
<VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00"
   Name="Visual C++ Project Properties" OutputDirectory="$(VCPACKAGES)"
   UseMFC="FALSE" UseATL="FALSE">

      <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="3"
         ForcedIncludeFiles="warning.h" /> 
      <Tool Name="VCMIDLTool" />
      <Tool Name="VCResourceCompilerTool" /> 
      <Tool Name="VCLinkerTool" OptimizeForWindows98="1" />

      <UserMacro Name="VCROOT" Value="$(DDROOT)\vc" /> 
      <UserMacro Name="VCPROJDEFAULTS"
         Value="$(BINDIR)\VC8\VCProjectDefaults" /> 
      <UserMacro Name="VCPACKAGES" Value="$(BINDIR)\VC8\VCPackages" />
      <UserMacro Name="INCLUDEPATH" Value="$(VCROOT)\Inc"
         InheritsFromParent="TRUE" Delimiter=";" />

</VisualStudioPropertySheet>

Use the XSD Schema for Property Sheets to validate your own .vsprops files.

See Also

Reference

Modifying Project Settings

Property Pages (C+)