views:

24

answers:

2

Hi

Visual Studio 2010 Premium, Native WIN32 MFC Project (no .net project in solution).

We have a complex solution with 35 projects. We have many clients for that product and what we normally do was to create a separate configuration for each client. Configuration did not have any major changes except few #define and changes to output directory. It was working fine but now with each change in product requires change in multiple configuration and is also error prone. We want to clean up multiple configurations with just one generic configuration depending on certain parameters and passing those parameters through a batch file for building builds.

to build for a client 'A' conditional compilation #define _BUILD_PROJECT_FOR "A" its output folder is in "c:\builds\client\a" out of 35 projects in solution we need only 32 projects for that client

What command and parameters to pass so that I can build a solution at command line by just passing #ifdef, what projects to build and their output directory.

I am trying with msbuild but unable to pass to compiler the preprocessor arguments.

A: 

For the preprocessor directives, you can check out this previous question.

expedient
I was able to find the solution using the the below linkBasically you have to define a constants in the project like<PreprocessorDefinitions> WIN32 ;...[ ]...;%( PreprocessorDefinitions); $ (MY_CONSTANTS) </ PreprocessorDefinitions>and the pass at command line msbuild ". \ BuildTest \ BuildTest.vcxproj" / p: Platform = Win32; Configuration = Release / p: MY_CONSTANTS = _EVALUATION_VERSION / p: TargetName = BuildTest32Eval
sudhir sharma