Sorry if it has been asked many times, but I still cannot make my way.
I've a C++ foo.sln generating foo.exe. I would like to script the generation passing different preprocessor options (like /DFOO1 /DFOO2 ...). There are msbuild, devenv, nmake, cmake, vcbuild ... This question being asked for more than a decade now!
For unknown reason 'msbuild foo.sln /p:DefineConstants=FOO1 /t:Rebuild', does not work (and '/D FOO1' does not even appear in the cl.exe generated command)! (Even it is not the right solution as I just want to add new defines not overwriting them all).
I am sure cmake will work, but I would like to avoid wasting time generating and maintaining both makefile & foo.sln)
Making several configurations (within foo.sln) for each combination is a nightmare as their number explode.
devenv seems too limited; nmake I don't know; vcbuild is obsolete?
It is quite strange for me to run into this issue in 2022, for this trivial workflow.
Thanks for your help
Using VS2017pro, here with vcvars64.bat