| 9 | {{{ |
| 10 | libs/libname - Main library directory |
| 11 | include/ - Library headers. Since most Boost headers go into boost/, the actual library headers will be in the subdirectory include/boost (or its subdirectoiries) |
| 12 | src/ - Source files for compiled library binaries (if any) |
| 13 | test/ - Regression tests |
| 14 | example/ - Example programs, libraries, and applications |
| 15 | doc/ - Documentation |
| 16 | }}} |
| 17 | |
| 18 | Throughout this document, we will use the Filesystem library as an example of a modular library. Please refer to the contents of ```libs/filesystem``` to see a fully-working modular library's description. |
| 19 | |
| 20 | == Restructuring the include directory == |
| 21 | |
| 22 | For most Boost libraries, the only changes needed to the directory structure is to introduce the include directory. To do so, create an empty directories ```include``` and then ```include/boost``` in ```libs/libname```. Then, add these two new directories to Subversion. If you're using the command-line Subversion, you can do this with the following command run from ```libs/libname```: |
| 23 | |
| 24 | {{{ |
| 25 | svn add include |
| 26 | }}} |
| 27 | |
| 28 | Next, we need to identify each of the include files that are part of this library (but *not* part of libraries that it depends on) and move each of these libraries from the main Boost include directory into our library-specific include directory. We handle library-specific subdirectories of the Boost include directories (e.g., ```boost/filesystem```) slightly differently from individual files (e.g., ```boost/shared_ptr.hpp```): |
| 29 | |
| 30 | * *Library-specific include directories* are handled by [http://svnbook.red-bean.com/en/1.1/ch07s04.html Subversion externals]. To move the directory ```boost/filesystem```, for example, one should first delete ```boost/filesystem``` entirely from the main Boost include directory. With the command-line Subversion, this can be done by changing into the top-level ```boost``` include directory (e.g., ```$BOOST/boost```) and running |
| 31 | {{{ |
| 32 | svn rm filesystem |
| 33 | }}} |
| 34 | Next, change into the appropriate include directory within the library-specific directory, e.g., ```libs/filesystem/include/boost```. Add a new Subversion ```svn:external``` property to this directory that references the corresponding include directory from the main Boost directory tree. For example, we want our ```filesystem``` directory to point at ```branches/release/boost/filesystem```. This way, our modularized version of the library automatically picks up fixes from the main release branch. |
| 35 | |