The Project Structure
Organize Erbsland Core Libraries Together
Erbsland Core is designed to live at <project>/erbsland/core.
Future Erbsland Core extension libraries can then be placed next to it at <project>/erbsland/<extension>.
Keeping these dependencies below one directory makes their ownership and CMake integration clear.
The completed tutorial project has this structure:
elgrep-project
├── erbsland
│ ├── core # Erbsland Core Git submodule
│ └── CMakeLists.txt # Aggregates Erbsland Core libraries
├── elgrep
│ ├── src
│ │ ├── ElGrepApp.cpp
│ │ ├── ElGrepApp.hpp
│ │ └── main.cpp
│ └── CMakeLists.txt
└── CMakeLists.txt
The application has a small class of its own rather than placing all behavior in main.cpp.
This separation keeps the program entry point simple and gives the application lifecycle a natural home.
Create the Project
Create and initialize the project repository:
$ mkdir elgrep-project $ cd elgrep-project $ git init
Add Erbsland Core at the recommended location:
$ mkdir erbsland $ git submodule add https://github.com/erbsland-dev/erbsland-core.git erbsland/core
Create the application source directory:
$ mkdir -p elgrep/src
When somebody clones the project later, they can initialize every dependency with one command:
$ git submodule update --init --recursive
The recorded submodule revision is part of your project. This lets you update Core deliberately, review its changes, and test the new revision before committing it.