Fix cmake build script for compiling examples

  * Almost there for production usage...