[cmake] port to cmake