I've a file custom.props where I define some macro to be used within the project. In the example, I've this:
<VST2_32_COMMAND_ARGS>$(TargetPath) /noload /nosave /noexc /noft</VST2_32_COMMAND_ARGS>
When I load the project, and I look at Properties, Debugging, Command Arguments, I can access to that macro VST2_32_COMMAND_ARGS. But the string is evalutated as /noload /nosave /noexc /noft
Basically, $(TargetPath) is not evaluted. In my case, that path point to a DLL, so it should be somethings like this:
"C:\Program Files (x86)\VstPlugins\Plug\vst2\Win32\bin\MyPlug.dll" /noload /nosave /noexc /noft
But its empty. How could I fix it? Also tried this:
<VST2_32_COMMAND_ARGS>"$(TargetPath)" /noload /nosave /noexc /noft</VST2_32_COMMAND_ARGS>
but the result is:
"" /noload /nosave /noexc /noft
To resolve this issue you should import your
custom.propsfile after importing fileMicrosoft.Cpp.targets:That because the value of Macros for Build Commands and Properties set by the file
Microsoft.Cpp.Current.targets:And the file
Microsoft.Cpp.Current.targetsis imported by the fileMicrosoft.Cpp.targets:So if you call the some macro in your custom file before importing the file
Microsoft.Cpp.targets, MSBuild could not get the value of macro.You can get those
.targetsfiles at following path:To verify the custom value of
VST2_32_COMMAND_ARGS, I add a simple target to output that value. So you project file should be like:After build completed, we could get the value of
$(TargetPath):My custom.props file:
Hope this helps.