1.编写CMakeLists.txt
add_executable (hello hello.c)
同目录下编写源文件 hello.c
#include <stdio.h>
int main()
{
printf("helloworld!\n");
return 0;
}
2.使用cmake生成工程文件
3.编译工程,运行。