[Build][CMAKE] Split some functions to cmake/
[Build][General] Warning to use CMAKE.