In the vs project configuration, you can see that vs provides you with some macros (macros), for example, but you cannot find the place to modify or add macros. After Google search, I found that the built-in macros of vs cannot be modified. Now there is still one problem. Can I add a new macro?
In the WebKit project, you can see that it has added several new macros, such as the following:
It is added in the configuration file. I still don't know how to add these macros in vs IDE. The following is the content in C:/cygwin/home/xufan/WebKit/webkitlibraries/win/tools/vsprops/debug. vsprops. You can see how to add the content in the bold Section:
<? XML version = "1.0" encoding = "Windows-1252"?>
<Visualstudiopropertysheet
Projecttype = "Visual C ++"
Version = "8.00"
Name = "debug"
>
<Tool
Name = "vcclcompilertool"
Optimization = "0"
Minimalrebuild = "true"
Basicruntimechecks = "3"
Runtimelibrary = "2"
/>
<Tool
Name = "vclinkertool"
Linkincremental = "2"
/>
<Tool
Name = "vcresourcecompilertool"
/>
<Usermacro
Name = "webkitconfigsuffix"
Value = "_ debug"
Repeated menvironmentset = "true"
/>
<Usermacro
Name = "libraryconfigsuffix"
Value = ""
Repeated menvironmentset = "true"
/>
<Usermacro
Name = "webkitdllconfigsuffix"
Value = ""
/>
</Visualstudiopropertysheet>
The following is an explanation of these macros I found on msdn (http://msdn.microsoft.com/en-us/library/c02as0cs (vs.71). aspx ):
Visual c ++ concepts: Building a C/C ++ Program
Macros for build commands and Properties
You can use these macros anywhere in a project'sProperty pagesDialog box where strings are accepted. These macros are not case sensitive.
Macro
Description
$ (Remotemachine)
Set to the value ofRemote MachineProperty on the debug property page. See changing project settings for a C/C ++ debug configuration for more information.
$ (Configurationname)
The name of the current project configuration (for example, "debug ").
$ (Platformname)
The name of current project platform (for example, "Win32 ").
$ (Inherit)
Specifies the order in which inherited properties appear in the command line composed by the Project Build system. By default, inherited properties appear at the end of the current property.1
$ (Noinherit)
Causes any properties that wowould otherwise be inherited, to not be inherited. The use$ (Noinherit)Causes any occurrences$ (Inherit)To be ignored for the same property.1
$ (Parentname)
Name of the item containing this project item. This will be the parent folder name, or project name.
$ (Rootnamespace)
The namespace, if any, containing the application.
$ (Intdir)
Path to the directory specified for intermediate files relative to the project directory. This resolves to the value forIntermediate directoryProperty.
$ (Outdir)
Path to the output file directory, relative to the project directory. This resolves to the value forOutput directoryProperty.
$ (Devenvdir)
The installation directory of Visual Studio. NET (defined as drive + path); Parameters des the trailing backslash '/'.
$ (Inputdir)
The Directory of the input file (defined as drive + path); Parameters des the trailing backslash '/'. If the project is the input, then this macro is equivalent to $ (projectdir ).
$ (Inputpath)
The absolute path name of the input file (defined as drive + path + base name + File Extension). If the project is the input, then this macro is equivalent to $ (projectpath ).
$ (Inputname)
The base name of the input file. If the project is the input, then this macro is equivalent to $ (projectname ).
$ (Inputfilename)
The file name of the input file (defined as base name + File Extension). If the project is the input, then this macro is equivalent to $ (projectfilename ).
$ (Inputext)
The file extension of the input file. It contains des the '.' before the file extension. If the project is the input, then this macro is equivalent to $ (projectext ).
$ (Projectdir)
The Directory of the project (defined as drive + path); Parameters des the trailing backslash '/'.
$ (Projectpath)
The absolute path name of the project (defined as drive + path + base name + file extension ).
$ (Projectname)
The base name of the project.
$ (Projectfilename)
The file name of the project (defined as base name + file extension ).
$ (Projectext)
The file extension of the project. It has des the '.' before the file extension.
$ (Solutiondir)
The Directory of the solution (defined as drive + path); includes the trailing backslash '/'.
$ (Solutionpath)
The absolute path name of the solution (defined as drive + path + base name + file extension ).
$ (Solutionname)
The base name of the solution.
$ (Solutionfilename)
The file name of the solution (defined as base name + file extension ).
$ (Solutionext)
The file extension of the solution. It provided des the '.' before the file extension.
$ (Targetdir)
The Directory of the primary output file for the build (defined as drive + path); Parameters des the trailing backslash '/'.
$ (Targetpath)
The absolute path name of the primary output file for the build (defined as drive + path + base name + file extension ).
$ (Targetname)
The base name of the primary output file for the build.
$ (Targetfilename)
The file name of the primary output file for the build (defined as base name + file extension ).
$ (Targetext)
The file extension of the primary output file for the build. It contains the '.' before the file extension.
$ (Vsinstalldir)
The Directory into which you installed Visual Studio. NET.
$ (Vcinstalldir)
The Directory into which you installed visual c ++. net.
$ (Frameworkdir)
The Directory into which the. NET Framework was installed.
$ (Frameworkversion)
The version of the. NET Framework used by Visual Studio. Combined with $ (frameworkdir), the full path to the version of the. NET Framework use by Visual Studio.
$ (Frameworksdkdir)
The Directory into which you installed the. NET Framework SDK. the. NET Framework SDK cocould have been installed as part of Visual Studio. NET or separately.
$ (Webdeploypath)
The relative path from the Web deployment root to where the project outputs belong. returns the same value as relativepath.
$ (Webdeployroot)
The absolute path to the location of. For example, C:/inetpub/wwwroot.
$ (Safeparentname)
The name of the immediate parent in valid name format. For example, a form is the parent of a. resx file.
$ (Safeinputname)
The name of the file as a valid class name, minus file extension.
1. use the command line property page for the property to see how properties are inherited. see specifying Project Settings with property pages for more information on property inheritance. see using $ (inherit) and $ (noinherit) for usage examples.
See also
Building C ++ projects in Visual Studio