# Building Own Application for iMX6 Linux

#### <a class="anchor" id="bkmrk--0"></a>Compile Tool Chain Preparations

For instructions how to install the toolchain please refer to the Yocto Project's Quickstart and Application Developer's Guide.

To add the header and lib directories to your path, you might have to call a script to set your environment variables:

<p class="callout info">This step is needed when you use our build-setup description.</p>

```
cd /opt/poky/x.y.z (where x.y.z is your BSP version)
sudo chmod +x environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
```

<p class="callout info">Should be done every new build (environment variables are valid per terminal session)</p>

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">  
</div></div></div>#### <a class="anchor" id="bkmrk--1"></a>Generate Makefiles with CMake

For general information about CGI Studio Build System and CMake properties available to configure Candera applications refer to CGI Studio Build System.

CMAKE-GUI has to be run on same terminal after source command (step 1)

To configure and generate makefiles for compiling the Player for IMX6 Linux, 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\\Candera\\Player
2. Point CMake to binary directory 
    - May not exist, create folder with CMake if necessary
    - Root directory for generated makefiles / solutions
    - Root directory for build artifacts
3. Configure 
    - Specify Unix Makefiles as generator for the project
    - Specify toolchain file for cross-compiling
    - Select the toolchain file \\cgi\_studio\_candera\\cmake\\toolchain-files\\GCC-toolchain-iMX6-Linux-yocto.txt
    - Press Finish
    - Afterwards “Configure” has to be pressed as often as there is still some entry red or the necessary configuration (e.g. CANDERA\_TEXTSHAPER = harfbuzz) is done.
4. Press Generate

</div></div></div>If the package supports "harfbuzz" as CANDERA\_TEXTSHAPER please set this entry appropriately because by default it is set to "ComplexLib". Resume the configuration by pressing “Configure” again.

<p class="callout info">Configure COURIER\_PLATFORM and COURIER\_PLATFORM\_CONFIG parameters</p>

#### <a class="anchor" id="bkmrk--2"></a>Building Application

After generating your CMake files, simply navigate to the specified build directory and type "make" with the terminal or console to start the build.

The output file can be found in your build directory's subfolder CGIApplication.

Copy the application to a dedicated folder in the NFS root and start it as described in the previous chapter.