Is it possible to specify the Filename as a compile time flag in vcxproj. I know the __FILE__ directive, but I want to provide just the name of the file without the extension to the C file as a define. I can’t see how we can provide different flags to different C files included in the ClCompile itemgroup. I tried this, but it didn’t work:
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">SRCFILE=%(Compile.Filename);%(PreprocessorDefinitions)</PreprocessorDefinitions>
Any suggestions on getting this working with both VS 2010 as well as via MSBuild ?
thanks,
The simplest way is to specify a preprocessordefinition per clcompile tag instead..like..