Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleCalculator/ $: tree
linenumberstrue
.
├── CMakeLists.txt
├── src
│   ├── CMakeLists.txt
│   ├── operations.cpp
│   └── operations.h
└── tst
    ├── CMakeLists.txt
    ├── run_tests.cpp
    └── test_operations.cpp

A project prepared in this way can be built using the cmake command. This is done in 3 steps, the first is to create a directory to store the build, e.g. named built inside the project folder. Then, inside this directory, a project must be configured and a native build system generated. Finally, the project can be built, compiled and tested. It is shown below:

Code Block
languagebash
linenumberstrue
../TDD-cpp/Calculator/ $: mkdir -p ./built/
../TDD-cpp/Calculator/ $: cmake -S . -B ./built/
../TDD-cpp/Calculator/ $: cmake --build ./built/