# Building Own Application for the RZA1H

#### Generate Makefiles with CMake

For general information about CGI Studio Build System and CMake properties available to configure Candera applications refer to <span style="color: rgb(230, 126, 35);">[CGI Studio Build System](https://doc316en.candera.eu/books/build-system-setup)</span>.

To configure and generate makefiles for compiling the CGI CourierSampleAppLight, follow below steps:

<div class="contents" id="bkmrk-point-cmake-to-sourc"><div class="contents"><div class="textblock">1. Point CMake to source directory 
    - Folder containing top-level "CMakeLists.txt", e.g. ```
         /cmake/Apps/Courier/CourierSampleAppLight
        
        ```
2. Point CMake to build directory 
    - May not exist, create folder with CMake if necessary
    - Root directory for generated makefiles / solutions
    - Root directory for build artifacts
3. Configure 
    - Specify MinGW Makefiles (Ninja) as generator for the project
    - Specify tool-chain file for cross-compiling
4. Select the toolchain-file from the delivery (adapt for your toolchain installation and application specific needs) ```
     /cgi_studio_devices/src/RZA1H/ToolchainFiles/GCC-toolchain-RZA1H_Native2D.txt
    
    ```
5. Adapt the CMake settings if necessary, e.g.: 
    - CMAKE\_BUILD\_TYPE-&gt; Debug or Release
    - Press Configure
6. Press Generate

</div></div></div>#### Building Application

After generating your cmake files, in Command Prompt simply navigate to the specified build directory and type "mingw32-make" ("ninja") to start the build.

The output executable file can be found in your build directory.

Open this file with the Green Hills MULTI IDE debugger and load it to RAM as described in the previous chapter.