Folder structure

Create the following structure. Files will be added later.

  • how-to-set-up-a-cpp-repo-using-a-cmake-structure: my project workspace folder
    • cmake: these will house all common cmake modules if we use any. You could repeat the same thing for subdirectories/projects
    • docs: will house the documentation of the project.
    • MyApp: The main application that will be created.
      • include: all header files
      • sources: all source files
    • MyHeaderOnlyLib: The name says it all. The library will only contain header files.
      • include: all header files
  • MyStaticLib: A static library containing some useful functions for our main application. Here you could go for a sub repository on git or an external library, but here I chose to integrate the library source in the same structure.
    • include: all header files
    • sources: all source files

There's also a build folder under the root folder, but it isn't shown in the hierarchy. This is mainly because it will be used by cmake for building the targets and the makefiles. These are files that are platform specific and thus don't belong in a git repository. More on that later

results matching ""

    No results matching ""