# How to build the source on Windows

## First Steps

#### Download and install the following programs:&#x20;

* [Visual Studio Community](https://visualstudio.microsoft.com/vs/)
* [CMake](https://cmake.org/download/)
* [Git](https://git-scm.com/) for Windows

#### Create or open a folder for the ApertusVR source code, here open Git Bash or any Git GUIs.&#x20;

In case of Git Bash copy the following into the command prompt and press enter:

&#x20;`$ git clone -b 0.9 --single-branch https://github.com/MTASZTAKI/ApertusVR.git`

![](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-LiloWqoeXn5pznYu9-L%2Fgit_bash_tutorial.PNG?alt=media\&token=9e9ef605-1174-4ddb-9670-4ac3a3ef24ab)

Otherwise, choose Clone Existing Repositorya and copy the following into the Source Location:&#x20;

&#x20;`git clone -b 0.9 --single-branch https://github.com/MTASZTAKI/ApertusVR.git`&#x20;

![](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-Lilogbe6Q7E6ebzVAIy%2Fgit_gui_tutorial.PNG?alt=media\&token=094788af-7ad6-4493-896c-24bdc7b8c6cf)

Choose a Target Directory and click Clone. When the cloning finished close Git.

#### Open CMake

Click *Browse Source...* and select ApertusVR folder. Than click *Browse Build...* and select a folder for the binaries.

![](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-LilpiZa20coOLbX1A-z%2Fcmake_tutorial1.PNG?alt=media\&token=5079076a-ecf4-4d74-91ec-7e038682f972)

Click *Generate* and select Visual Studio 15 2017 Win64, then click *Finish*.

![](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-LilpnvfDSlx_Opsb4RS%2Fcmake_tutorial2.PNG?alt=media\&token=e808334b-8b90-44f8-9f88-29075873b31f)

After the process completed close CMake.

#### Open the folder where the binaries were built

Here can be found the apertusVR.sln file.

![aperusVR.sln](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-LiltMtuL5mxBbON88aD%2Fvs_tutorial1.PNG?alt=media\&token=77f77d0e-023b-4198-ab17-ed8f64ba35b2)

Open it with Visual Studio, set the Solution configuration to release and build the project.

![set to release](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-LiltSk62XZVavuKrTo7%2Fvs_tutorial2.png?alt=media\&token=d73b8497-4c9d-4f2f-ac73-83622869066f)

![build the solution](https://4044724383-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEyKyxZqxfQ560k-THK%2F-LilTrduYKS-shH8UNz0%2F-LiltUkXV1AHeS_QU5mS%2Fvs_tutorial3.png?alt=media\&token=8d40082c-6a8b-4a4d-9d50-071021feb2f3)

## CMake

The source code of ApertusVR uses [CMAKE](https://cmake.org/), which gives you the opportunity to use an IDE or platform of your choice.

## Git

The "master" branch is considered stable, at all times. The "develop" branch is the one where all contributions must be merged before being promoted to master. If you plan to propose a patch, please pull-request it into the "develop" branch, or its own feature branch. Direct commit to "master" are not permitted.

## C++ coding style

### The #define Guard

All header files should have `#define` guards to prevent multiple inclusion. The format of the symbol name should be `<APE>_<PLUGINNAME>_H`.

```
#ifndef APE_TESTERPLUGIN_H
#define APE_TESTERPLUGIN_H

...

#endif  // APE_TESTERPLUGIN_H
```
