1

I have built a project that will require a specific #define.

The directions for building that project say "When compiling your project, make sure to #define BLAH".

I would like to make a property sheet and place this directive in the property sheet, so that the people who build a project will not have to worry about it, will just include the property sheet.

Is it possible to place an include directive in a property sheet, and how would that be written ?

Thank you.

Thalia
  • 13,637
  • 22
  • 96
  • 190
  • 1
    Is this question about MS Visual Studio? – anatolyg Nov 13 '13 at 21:33
  • A *property sheet* is a container for one or more *property pages*. Placing a compiler directive into a property sheet does not compile to make sense. Please provide a concise problem description. – IInspectable Nov 13 '13 at 21:46
  • Yes the question was about MS Visual Studio, c++ projects. Sorry I did not specify. "Placing a compiler directive" - sorry I don't understand that, the information in the property sheets is used to build/link projects... so I see nothing odd about defining a variable that would be checked by #if defined BLAH ...#endif statements ? Such a variable seems to be able to be defined anywhere... Including in the project file ? Which means that the same could be done in the property sheet... I just have never seen an example of it. – Thalia Sep 03 '14 at 14:29

1 Answers1

1
<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup>
    <ClCompile> 
      <PreprocessorDefinitions>BLAH;%(PreprocessorDefinitions)</PreprocessorDefinitions>    
    </ClCompile>
  </ItemDefinitionGroup>  
  <ItemGroup />
</Project>
Thalia
  • 13,637
  • 22
  • 96
  • 190