Dividing C++ Application into Libraries
<p>My C++ project is growing larger. We are also moving to using cmake for building now. I want to divide the application into libraries so that they can be linked for testing, preparing the application package, etc. Right now I would divide my code into libraries as follows:</p>

<ul>
<li>core</li>
<li>GUI</li>
<li>utilities (these are used by core and other components)</li>
<li>io (xml parsing/outputing using print functions of classes in core)</li>
<li>tests (unit tests)</li>
<li>simulator (tests the core)</li>
</ul>

<p>An alternative would be to divide based on the directory structure - one library for each directory. But from my past experience it leads to too many libraries and then library dependencies become tough to handle during linking.</p>

<p>Are there any best practices in this regard?</p>
