In a C++ file, I have a code like this:
#if ACTIVATE
# pragma message( \"Activated\" )
#else
# pragma message( \"Not Activated\")
#endif
I
Use the CL environment variable to define preprocessor macros
Before calling MSBUILD, simply set the environment variable 'CL' with '/D' options like so:
set CL=/DACTIVATE
to define ACTIVATE
You can use the '#' symbol to replace '=' sign
set CL=/DACTIVATE#1
will define ACTIVATE=1
Then make the call to MSBUILD
More documentation on the CL Environment Variables can be found at: https://msdn.microsoft.com/en-us/library/kezkeayy(v=vs.140).aspx