Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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:

drive:/libraries/libname/includes/libname/framework

drive:/libraries/libname/includes/libname/utitlies

drive:/libraries/libname/lib/...

etc

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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