Skip to content

Commit

Permalink
docs: update build instruction (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsanima authored Aug 24, 2024
1 parent f83f9c0 commit 15d297c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cmake-demo
# CMake Demo

Introduction to [CMake](https://cmake.org/) configuration for building and running simple demo
**C/C++** programs.
Expand All @@ -8,7 +8,7 @@ Introduction to [CMake](https://cmake.org/) configuration for building and runni
> To build the sample _demo_ programs that are in the _example_ and _project_ directory, we are
> using `cmake` build system command on **WSL** or another virtual machine with a **GNU/Linux**
> system, such as **Debian**, **Ubuntu**, **Fedora**, **CentOS**, and so on. The choice is yours.
> Currently, we only support the _amd64_ architecture.
> Currently, we only support the _amd64_ and _arm64_ architecture.
Make sure you have a program called **CMake** installed, as well as a compiler for the **C/C++**
languages, typically by entering the following command in the terminal:
Expand All @@ -19,6 +19,13 @@ sudo apt install cmake gcc g++
cmake --version
```

Also you can install `clang-format` and `clang-tidy` for formatting the code and other cool stuff,
type the following command in the terminal:

```shell
sudo apt install clang-format clang-tidy
```

First step is a create build directory and generate the build files using `cmake` command from the
top-level project directory, type the following command:

Expand All @@ -34,10 +41,11 @@ Navigate to the `build` directory and run the `make` command to build the execut
demo programs:

```shell
cd build
make
cd build ; make
```

The demo programs should be compiled, and now you can run the programs.

> [!CAUTION]
>
> For the build to succeed, you must copy the header file `mdsanima.h` into the `/usr/local/include`
Expand Down Expand Up @@ -107,7 +115,7 @@ Here is a example instruction for compiling and linking the source code files, t
command:

```shell
cd example/mdsanima-fantastic && mkdir build
cd example/mdsanima-fantastic ; mkdir build
g++ -o build/mdsanima-fantastic main.cc
./build/mdsanima-fantastic
```
Expand Down

0 comments on commit 15d297c

Please sign in to comment.