views:

60

answers:

1

I have an MSVC Makefile Project in which I need to set an environment variable before running NMAKE. For x64 builds I needs to set it to one value, and for x86 builds I need to set it to something else.

So for example, when doing a build I would want to SET PLATFORM=win64 if I'm building a 64-bit compile, or SET PLATFORM=win32 if I'm building 32-bit.

There does not appear to be an option to set environment variables or add a pre-build even for makefile projects.

How do I do this?

EDIT: Running MSVC 2008

+1  A: 

Just edit the Configuration Properties + NMake + Build Command Line. Click the button with the dots and enter something like this:

set PLATFORM=win32
nmake -f makefile.mak

Repeat for your 64-bit configuration.

Hans Passant
Simple, elegant, beautiful
John Dibling