The Pitchfork Layout (C++)

I recently stumbled over ‘The Pitchfork Layout‘ and I know there are so many ways to order your project files, but this one seems to be very systematic and has a proper documentation.


Top-level directories

build    ... Directory for the build artifacts. (Not part of the repo.)
data     ... Directory for the non-source files, like INI files.
docs     ... Directory for the documentation.
examples ... Directory for the samples and the examples.
external ... Directory for the used external projects.
extras   ... Directory for the submodules not build by default.
include  ... Directory for the public headers.
libs     ... Directory for the submodules build by default.
src      ... Directory for the source files and the private headers.
tests    ... Directory for the tests cases.
tools    ... Directory for the development utilities.

Source code placement

1. Merged

<root>/
    src/
        <namespace_0>/
            .../
                <namespace_X>/
                    <class>.hpp
                    <class>.cpp

2. Seperated

<root>/
    include/
        <namespace_0>/
            .../
                <namespace_X>/
                    <class>.hpp
    src/
        <namespace_0>/
            .../
                <namespace_X>/
                    <class>.cpp

Unit test placement

1. Merged

<root>/
    src/
        <namespace_0>/
            .../
                <namespace_X>/
                    <class>.cpp
                    <class>.test.cpp

2. Seperated

<root>/
    src/
        <namespace_0>/
            .../
                <namespace_X>/
                    <class>.cpp
    test/
        <namespace_0>/
            .../
                <namespace_X>/
                    <class>.test.cpp

(Added by me, cause the documentation isn’t specifying the structure under test/)