title: Accessing %(PreprocessorDefinitions) from Pre-Build Event command line in Visual Studio 2010
body: <p>I’m having some difficulty with the Visual Studio 2010 build process.  To put it simply, I would like to pass the preprocessor definitions set up for the currently building configuration into a batch file via the Pre-Build Event command line.</p>
  
  <p>The preprocessor definitions are in the projects properties under C/C++ > Preprocessor > Preprocessor Definitions.  I do see the name of the macro as %(PreprocessorDefinitions) when in that property sheet, however that macro doesn’t show up in the Macro list for Build Events > Pre-Build Event.</p>
  
  <p>Is there any way to access %(PreprocessorDefinitions) from within the Build Events > Pre-Build Event > Command Line?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Additional Details:</strong></p>
  
  <p>Let me be more specific…  I’m using a slightly modified version of vs-android in order to build Android apps from within Visual Studio.  I have in the past edited the vs-android source to add specific elements we need to the build process.  I’ve noticed that the PreprocessorDefinitions are in an ItemDefinitionGroup called “ClCompile”.  I can’t seem to access the defines using %(ClCompile.PreprocessorDefinitions) from within the .props or .xml build files.</p>
  
  <p>Is there a way to tell Visual Studio to make %(ClCompile.PreprocessorDefinitions) part of the environment, so perhaps it will show up as $( PreprocessorDefinitions)?  If so, I have not been able to find out how.</p>