Reputation: 34396
I'm kind of new to C++ (learning some game programming stuff) and I want to set up my directory structure using common conventions. My main point of confusion, which I haven't seen a clear recommendation for, is where I put dependencies. For example, I'm going to be looking at FreeGLUT and FreeType. The first thing I've downloaded is the MSVC build of FreeGLUT and it comes with a subdirectory structure like so:
bin/
freeglut.dll
x64/
freeglut.dll
include/
GL/
someheaders.h ...
lib/
freeglut.lib
x64/
freeglut.lib
readme.txt
The C# developer in me wants to create a subdirectory called "Dependencies" within my solution directory, take all of this and put it in its own subdirectory there, and then do the same with any other libraries, similar to the NuGet packages directory, then reference the appropriate locations when building. I'm not 100% sure but I'm guessing this might be messy with regards to referencing header files if they're scattered throughout different subdirectories, given that you don't just "Add References" in C++ like you do in C#.
Should my dependencies be part of my project? Should I break them out into different base folders? What's the standard thing to do?
n.b. I understand that lib or dll is a choice (i.e. you don't use both in your build)
Upvotes: 2
Views: 2740
Reputation: 4325
The more-or-less standard solution is as follows:
This is what e.g. the Inkscape project does: there is a main repository at https://launchpad.net/inkscape with the complete source code of the project, and there is a separate repository at https://launchpad.net/inkscape-devlibs with the binaries of the dependencies required to build under Windows.
This way you will avoid cluttering up the revision history with dependency changes and storing large binary files in your main tree.
Upvotes: 2