1.基本测试
最基本的功能就是利用源代码文件生成一个可执行程序。CMakeLists.txt:Tutorial.c:cmake_minimum_required ( VERSION 3.5) project (Tutorial) add_executable(Tutorial tutorial.c)
利用CMake组建,Visua// A simple program that computes the square root of a number #include <stdio.h> #include <stdlib.h> #include <math.h> int main (int argc, char *argv[]) { double inputValue = 4; double outputValue = sqrt(inputValue); fprintf(stdout,"The square root of %g is %g\n", inputValue, outputValue); return 0; }