views:

108

answers:

2

Hi all,

I have a Visual Studio 2008 solution comprised of several projects. Only some header files in each project represents API to the library built from the project.

Is there a way in Visual Studio to copy the files to a common directory prior compilation? (I want to do it in order prevent including unintentionally header file I'm not supposed to)

Thanks Dima

+1  A: 

You can run a script before compilation to do this (see pre-build step) but I don't think this is what you are asking.

Do you mean how can you have header files in another directory used by several projectS? Simply add that directory to the "Additional Include Directories" field in project settings-C++ ->General >

Martin Beckett
+2  A: 

Yes, on the project menu, select properties->configuration properties->build events->pre-build event. In the command line section you can enter a copy command with your source and destination paths. You may find the $solutiondir macro useful when enterting your paths.

DanDan