new: initial port to CMake