Skip to content
Plaristote edited this page Mar 3, 2016 · 3 revisions

Tasks are binaries which are linked to the application library. They can perform anything the application would, but they do it in a separate process.

Create a new task

To create a new task use the following command

$> crails task add my_task

This will create a new directory tasks/my_task. It contains two files:

  • The CMakeLists.txt file is used during your application build to generate the task's binary.
  • The main.cpp file contains the entry point of your task (the main function).

Compile a task

The crails task add command automatically adds your task to your application's CMakeLists.txt file. Your task will be built along with your application.

Perform a task

If your build directory is called build, then the binary for a task named my_task would end up in build/tasks/my_task/task. You must run the task from the root directory of your application:

$> build/tasks/my_task/task [arguments]