views:

24

answers:

1

Using the following pseudo-code:

#define BUILD_PATH "C:/MyBuild/"
#define BUILD_NAME "mydll.dll"
// Set build path here

representing how I would like to build the current project (a dll) into C:/MyBuild/mydll.dll, how would I accomplish this by only using preprocessor directives?

Thanks a bunch!

+1  A: 

I may be misunderstanding, but I really cannot understand WHY you want to do this but it is doable:

#pragma comment( linker, "/out:c:\mydll.dll" )

I cannot re-iterate enough exactly how much you don't want to be doing this though ...

If you want to GET the output path via pre-processor info then, I'm afraid ... you can't. That info comes from several steps after the pre-processor so there is no way the pre-processor could get that info.

Goz
It's to be used as a configuration file for a small project template. It's a very questionable way, I'm sure, but for the audience I'm distributing this for, I feel they would appreciate having all this info set in the main file instead of flipping through the property pages to set the linker info each time they copy and paste the template.
Gbps