Migrating to CMake as build system