Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Using Shawn as a library

Marvin Frick edited this page May 28, 2013 · 1 revision

It is possible to write your own application and just link in the Shawn lib(s) instead of using the provided Shawn frontend. There are several options to achieve different goals:

BUILD_LIB_WITH_MAIN
  • Enabled When this option is enabled, Shawn will build it's main method into it's lib. Your own application shouldn't provide a main method by itself, as it is already existing in libshawn. This method is more for extending Shawn and will in general create an application which looks and works pretty much the same as the provided Shawn frontend does.
  • Disabled When this option is disabled, you are able to create your own application with your own main method. You have to call Shawn's initialization methods by hand though and also provide your own way to call tasks and such (like Shawn's configuration files).
BUILD_SINGLE_LIB
  • Enabled Creates a single lib of Shawn containing the system as well as all activated app modules. In your own project, you just have to link in the libshawn lib, and dependecies like cairo if they were activated in CMake.
  • Disabled Splits up Shawn into several libs, one for Shawn itself (libshawn), one for the legacyapps (if enabled) and one for each of the applications in shawn\src\apps. It is possible to build Shawn once with every app enabled, but to only link the libs into your project, that you really want to use. So if the Vis app was built with Shawn but you don't want to use it, just ignore the lib. This only works correctly with BUILD_LIB_WITH_MAIN disabled though, and you should regard some app dependencies (one app may need another one to work correctly).