Building with cmake
Small changes and fixes
O2 optimization level for g++