How to add macros to visual studio project?
I need to add a macro to a visual studio project so that i could use this macro to set properties of the project.
e.g. I could replace 192.168.1.50 to a macro naming $(RemoteComputer).
Could I do this?
- Make it an environment variable like PATH or APPDATA (My Computer->Properties->Advanced->Environment Variables). Note that you need to restart MSVC or it will not find the new environment variables.
- If you want the setting only for a single project, then open the .vcxproj file and go to Project/PropertyGroup[Label="Globals"]. Add a new tag here, e.g. FooBar and it will appear as a $-macro in the studio-settings for that project.