# Custom Effect Set

<a class="anchor" id="bkmrk-"></a>It is now possible to configure the list of Effects required by the application. A new project will be created in this regard, which will include the generated EffectSet and the necessary dependent source files.

#### <a class="anchor" id="bkmrk--0"></a>CMake Flag

A new flag has been introduced to specify that a custom Effect Set shall be used: **CGIAPP\_ENABLE\_CUSTOM\_EFFECT\_SET**. This feature is disabled by default.

#### <a class="anchor" id="bkmrk--1"></a>CMakeLists Template File

A CMakeLists.txt template file can be used as reference on how to configure the custom effect set and integrate it in the application. This is located in *cgi\_studio\_candera/templates/EffectLists.template.txt*

<div class="contents" id="bkmrk-cgieffects_list---re"><div class="contents"><div class="textblock">- CGIEFFECTS\_LIST - refers to a list of [Candera](http://dev.doc.cgistudio.at/APILINK/namespace_candera.html "[DataBinding_RefTypeSample]") Effects that should be added to the generated EffectSet
- CGIEFFECTS\_PROJECTNAME - specifies the project name

</div></div></div>#### <a class="anchor" id="bkmrk--2"></a>Integrate Custom Effect Set into application

<div class="contents" id="bkmrk-create-a-new-folder-"><div class="contents"><div class="textblock">- Create a new folder in the application source directory (eg: Effects) and add a *CMakeLists.txt* file inside, based on the template file mentioned above.
- Populate the list of needed effects and specify the project name.
- In the CMake configuration file of the application add the following line: CgiAddProject(Effects).
- Configure and build the application as usual.

</div></div></div>#### <a class="anchor" id="bkmrk--3"></a>Example CMakeLists file

<div class="contents" id="bkmrk-do-not-include-the-%22"><div class="contents"><div class="textblock"><dl class="note"><dt></dt><dd><p class="callout info">Do not include the "Candera" namespace, this will be automatically added when the EffectSet will be generated.</p>

</dd></dl><div class="fragment">  
</div></div></div></div>```
  # Effect List
  set(PRV_CGIAPP_EFFECT_LIBRARY_LIST
      GlRadialGradientBrushBlend
      BitmapBrushBlend
      BitmapBrushColorBlend
      ShadowBitmapBrushBlend
  )

  set(PRV_CGIAPP_EFFECTSET_SUBDIRS
      .
  )
    
  CgiGetCurrentDir(PRV_CUR_DIR)

  # Enable Custom EffectSet flag
  set(CGIAPP_ENABLE_CUSTOM_EFFECT_SET TRUE CACHE BOOL "Enable Custom Effect Set")

  # Include EffectSet Generator
  set(CGISTUDIO_EFFECTSET_CMAKE_INCLUDE "${FeatStd_DIR}/cmake/cgistudio/cgistudio_effectset_generator.cmake")
  if(EXISTS ${CGISTUDIO_EFFECTSET_CMAKE_INCLUDE})
      include(${CGISTUDIO_EFFECTSET_CMAKE_INCLUDE})
      # Create Custom EffectSet
      if(CGIAPP_ENABLE_CUSTOM_EFFECT_SET)
          CgiCreateEffectSet("EffectSet" "${PRV_CGIAPP_EFFECT_LIBRARY_LIST}")
      endif(CGIAPP_ENABLE_CUSTOM_EFFECT_SET)
  else()
      message(FATAL_ERROR "EffectSet Generator '${FeatStd_DIR}/cmake/cgistudio/cgistudio_effectset_generator.cmake' could not be found, further processing is aborted.")
  endif()
```

<div class="contents" id="bkmrk-is-is-not-possible-t"><div class="textblock"><div class="fragment">  
</div><dl class="note"><dt></dt><dd><p class="callout info">Is is not possible to generate an empty EffectSet. An appropriate error message will be shown during project configuration and further processing will be halted.</p>

<p class="callout info">The user takes responsibility of assuring that all effects which are needed by the used CGI Studio products are included. (eg.: [Candera::BitmapBrushColorBlend](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_bitmap_brush_color_blend.html "Output a bitmap image, modulate the color, and blend it with the store buffer. Same as chaining (Bitm...") is required by [Candera::TextNode2D](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_text_node2_d.html "TextNode2D is a RenderNode that renders text using the attached BitmapBrush effect.")).</p>

</dd></dl></div></div>