migrate to CMake