migrate build system to CMake