Cmake build system now working. Still needs some improvements.