I'm working on some static libraries using visual studio 2012, and after building I copy .lib and .h files to respective directories to match a desired hierarchy such as:





I'm thinking something similar to the boost folder layout.

I have been doing this manually so far. My library solution contains projects, and when I update and recompile I simply recopy files where they need to be. Is there a simpler way to do this? Perhaps a way to compile the project with certain rules per project as to where the projects .h and .lib files should go?

1 Answer 1


I would suggest creating a deployment MSBuild file that copies your files to the various destination directories. This will keep all your deployment rules in one place, and allow you to change both source and destination without impacting your other projects.

MSBuild has globbing features that will allow you to group your framework and utility features together and talk about them as a group. Since Visual Studio projects are MSBuild projects, you could probably find a way to include the deployment project in your solution.

Is there a reason you would like to deploy from the IDE? I would suggest you have a stand alone deployment step. Including deployment in the normal compile process can lead to confusion when there are build errors or copy errors. Mismatched versions end up in a library directory and people forget and waste time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.