rewrite with CMake