Add cmake makefiles

Separate object files were previously built and statically linked to
example binaries. Add a cmake-based buildsystem to properly generate
a library, and link the example binaries to this library we generated.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>