restructured for cmake build.
possibly this can be imported to Xcode or eclipse...
Next step is to create wrapper in C++