This project is intended to serve as a learning project for cpp projects. I will extend this readme throughout the work on this project and collect thoughts, goals and useful links here. I will include some test cpp/hpp files to show how all of this works (and to test it).
Nix installs all the dependencies, you can use CMake to build the project:
$ nix-shell
nix-shell$ cd bin
nix-shell& cmake .. -G Ninja
nix-shell& ninja
This project uses Catch2 and libFuzzer to test the libraries, you can run them
from inside the bin
folder:
nix-shell$ ctest
I think the following folder structure should work well with most projects:
.
+-- _app # the code of the app developed in this project
| +-- _include
| +-- _src
+-- _bin # binary files, content not uploaded to git
+-- _cmake # cmake related files
+-- _lib
| +-- _<libname_1>
| +-- _include
| +-- _<libname_n>
| +-- _include
+-- _nix # nix related files
+-- _test # testing related files
| +-- _unit
| +-- _fuzz
The lib
folder should contain only libs that I have written myself for this project.
All the other libs should be managed by nix.
I want CMake to
- build my application
- build my libs and link them correctly
- build my tests
- unit tests
- fuzz tests
- maybe more
- run static analysis
I will start working on nix when at least some CMake stuff works, but I will include a shell.nix
file to be able to build all this in a nix-shell.