I have a project I\'m working on (for school) that I\'m digging into the Boost libraries for the solutions. I need some way to distribute the required Boost source code with
This seems a bit odd to me. If you are distributing source code, then the people you are distributing to should be able to install boost. Then if they already have boost, there is no duplication and confusion, or if they do not and you need a built library, they will build the correct library for their system. If the people you are distributing are not up to installing boost, then I would suggest distributing binaries in an install package to make it as easy as possible for them.
It depends on the library you're using. If you're using a header-only library (most of the boost libraries are, some notable exceptions are signals, serialisation and date/time) you can just copy those header files. Otherwise you'll need to copy the cpp files, too. My suggestion is to just include them into your project.
So, here's what you do: you remove the boost include path from your project settings (tool->options->projects and solutions->vc++ directories->include files). Try to compile. Look at which include fails. Copy that file from your boost directory to your project directory. Lather, rinse, repeat until your project compiles.
If you're using a library that requires .cpp files, you'll get an error at link time. Copy all .cpp files of the library you use to your project directory and add them all to your solution. Rebuild and cross fingers.
For a more detailed answer, please post which libraries you're using.
Based on your comment that you're using regex, here's what you do: download the 'normal' boost distribution zip file. Unzip it somewhere. Go to libs/regex/src. Copy and paste all the .cpp files in that directory to your project directory. Add them to your Visual Studio project (right-click, 'add' -> 'existing item'). Then go to boost/regex and copy everything in there (the header files) to your project directory (including the subdirectories). Change all the includes in your own .cpp and .h files from #include to "regex.hpp" so that it includes the headers from your local directory and not those that were installed system-wide. Make sure to remove the system-wide include path from your project settings like I said in my last post.
Then, compile your code. You'll get a number of 'missing include file' errors because regex depends on other boost libraries. Repeat the whole process: go to boost/xxx where xxx is the library that regex is looking for. You can deduce the library from the error message. Copy everything that the compiler asks for to your own project directory. You may need to fiddle a bit with your directory layout before it works. It's really a step by step approach, where every step is the same: identify the missing file, copy it over, see if that include is found and fixed, and continue with the next step. This is boring work I'm afraid.
You could automate this all with bcp but for a one-off project like a school project I wouldn't bother; only if you think you'll have future projects that will require you to deliver a self-contained zipfile.
I've come across this before, embedding boost into my projects. Each individual boost library comes with various project files for building with different make systems (Jam, make, Visual Studio 6...) but they're never so great with the newer versions of VS.
I always prefer to create a new project file and embed boost directly into my project. It's pretty simple, you just need to add all of the source files and set the project options properly. There is one caveat, however, and that is you must name the library output file the as boost does, because their include files depend on that.
Once you've done this, you can distribute the boost libraries just like any other files in your project.
Try calling bcp with this command:
"c:\Program Files\boost\boost_1_34_1\bin\bcp.exe" --boost="c:\Program Files\boost\boost_1_34_1" regex regex
--boost
tells bcp where boost is installed, the first regex
is the name of the modules, the second is the destination directory.
Oh, and if you haven't already noticed, there are Visual C++ makefiles in libs\regex\build\
.
It is such a PITA to compile boost; only the motivated students are going to be able to do it. Have you considered bundling the installer?