...
Code Block |
---|
language | bash |
---|
title | Calculator/ $: tree |
---|
linenumbers | true |
---|
|
.
├── 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 |
---|
language | bash |
---|
linenumbers | true |
---|
|
../TDD-cpp/Calculator/ $: mkdir -p ./built/
../TDD-cpp/Calculator/ $: cmake -S . -B ./built/
../TDD-cpp/Calculator/ $: cmake --build ./built/ |