added CMake build script
fixed compilation on OS X Mavericks