Changes between Version 2 and Version 3 of CMakeModularizeLibrary


Ignore:
Timestamp:
May 23, 2008, 3:15:24 PM (14 years ago)
Author:
Douglas Gregor
Comment:

Finish up discussion of fixing header structure

Legend:

Unmodified
Added
Removed
Modified
  • CMakeModularizeLibrary

    v2 v3  
    2626}}}
    2727
    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```):
     28Next, 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 headers (e.g., ```boost/shared_ptr.hpp```):
    2929
    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
     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
    3131{{{
    3232svn rm filesystem
    3333}}}
    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.
     34  Next, change into the include directory within the library-specific directory, e.g., ```libs/filesystem/include```. Add a new Subversion ```svn:externals``` 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. The ```svn:externals``` property contains one or more lines corresponding to external definitions. Each line contains the local directory name (e.g., `filesystem`) followed by a space and then the Subversion directory that this directory will come from, e.g., https://svn.boost.org/svn/branches/release/boost/filesystem. For example:
     35{{{
     36filesystem https://svn.boost.org/svn/boost/branches/release/boost/filesystem
     37}}}
     38  The `svn:externals` property with this value must be attached to the library-specific `boost` subdirectory, because each line is a subdirectory within `boost`. Using the command-line Subversion client, this can be done with:
     39{{{
     40svn propset svn:externals "filesystem https://svn.boost.org/svn/boost/branches/release/boost/filesystem" boost
     41}}}
     42  Note that, to see the actual changes this involves, you will need to commit all of your changes to the Subversion repository and then execute an update operation.
    3543
     44  * Individual headers are handled by moving the headers from the main Boost include directory into the library-specific include directory. This is effectively just a rename operation, e.g., to rename `boost/shared_ptr.hpp` to `libs/smart_ptr/include/boost/shared_ptr.hpp`. To perform this rename operation via the command-line Subversion client, change to the top-level Boost directory and execute
     45{{{
     46svn move boost/shared_ptr.hpp libs/smart_ptr/include/boost/
     47}}}
     48
     49Once all of the headers have been moved and the changes have been committed, there should be no remaining headers in the main Boost include directory.