# Integrate Candera into Custom Build Environments

#### <a class="anchor" id="bkmrk--1"></a>Integrate Candera into Custom Build Environments

For building [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") as part of the Player demo application, please refer to <span style="color: rgb(230, 126, 35);">[Building the Player](https://doc316en.candera.eu/books/build-system-setup/chapter/building-player-widgets-and-schost)</span>.

If a custom application should include [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") libraries, this chapter explains the CGI-Studio library build process. To simplify integration of [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") source code into a custom build environment references to [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") compile switches are given below.

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### <a class="anchor" id="bkmrk--2"></a>Build Cgi-Studio Candera libraries with CMake

Use CMake to create a Visual Studio solution for host or any other build environment (like make files for targets) and build [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") libraries.

<div class="contents" id="bkmrk-start-cmake-point-%22w"><div class="contents"><div class="textblock">1. Start CMake
2. Point "Where is the source code" to *&lt;cgi-studio-root&gt;/cgi\_studio\_candera/src*
3. Point "Where to build the binaries" to *&lt;cgi-studio-root&gt;/cgi\_studio\_candera/build*. Note that the name of the build directory can be freely chosen but it is required to create it on the same directory level as "src". Avoid blanks in the path
4. Click "Configure" and select the proper generator for the desired build environment.   
    &gt; As an example, for host builds using Visual Studio 2010, select "Visual Studio 10".   
    &gt; For target builds, please refer to the given target-specific setup documentation part of CGI Studio releases.
5. Confirm the dialog with OK. All [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") CMake settings which can be configured will appear in the main window, having red lines for all settings to be confirmed.
6. Check and modify the [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") CMake properties and click "Configure" again
7. As long as red lines are visible, those lines must be confirmed by clicking "Configure" again.
8. If no more red lines are visible, the "Generate" button is enabled. Click "Generate" to create the Visual Studio solution (or the make files for make-based build environments).

</div></div></div>Build [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") with the CMake-generated build environment (Visual Studio solution for host, e.g.).

<p class="callout info">Candera libraries will be available in the separate folders in the given build directory.  
To collect all of the libraries in a specific folder, an output path can be specified during CMake configuration:  
 - Tick the "Advanced" checkbox in the CMake GUI.  
 - After pressing "Configure", the CMake property "CANDERA\_ENABLE\_LIBRARY\_OUTPUT" will become visible. Tick this and press "Configure" again.  
 - Specify the library output directory in the "LIBRARY\_OUTPUT\_PATH" CMake variable.</p>

<div class="contents" id="bkmrk--0"><div class="contents"><div class="textblock"><dl class="note"><dd></dd></dl>---

</div></div></div>#### <a class="anchor" id="bkmrk--3"></a>Integrate Candera Source Code (Compile Switches)

When [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") source code is built using [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") CMake configuration, all relevant compile switches (defines) are already set by CMake. The template CanderaConfig.h.template (refer to *&lt;cgi\_studio\_root&gt;/cgi\_studio\_candera/cmake/templates*) is used by CMake to generate the file CanderaConfig.h in the build directory.

If [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") source code is built using a custom build environment, learn about all configuration defines available for [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") in the [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") API Documentation:

<div class="contents" id="bkmrk-candera_api_document"><div class="textblock">- [CANDERA\_API\_DOCUMENTATION/CANDERA GRAPHIC ENGINE/CANDERA CONFIGURATION](http://dev.doc.cgistudio.at/APILINK/group___config.html)

</div></div>