You can use ReadLinesFromFile, the CreateProperty and the item.Replace function to update your property by using the batching capabilities of the msbuild engine:
<!-- property defintion -->
<PropertyGroup>
<MacroFile>def.txt</MacroFile> <!-- the filename with your #defines -->
</PropertyGroup>
<!-- other stuff in your build file -->
<!-- import common targets near the end of your build file -->
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- override targets (make sure this is AFTER the import elements) -->
<!-- BeforeBuild is pre-dfined target which can be overriden -->
<Target Name="BeforeBuild">
<!-- Open the #define file and read every line in items named
MacrosFromFile
-->
<ReadLinesFromFile
File="$(MacroFile)" >
<Output
TaskParameter="Lines"
ItemName="MacrosFromFile"/>
</ReadLinesFromFile>
<!-- Create a new property called FileDefineConstants combining
every Item from MacrosFromFile
using the built-in replace statement to get
rid of the #define instruction
-->
<CreateProperty
Value="@(MacrosFromFile->Replace('#define ', ''))">
<Output
TaskParameter="Value"
PropertyName="FileDefineConstants" />
</CreateProperty>
<!-- re-create the orignal DefineConstants combining the current value
and the value from FileDefineConstants -->
<CreateProperty
Value="$(DefineConstants);$(FileDefineConstants)">
<Output
TaskParameter="Value"
PropertyName="DefineConstants" />
</CreateProperty>
<Message Text="Const >> $(DefineConstants)" />
</Target>