Cmake的HelloWorld
在文件夹中,同时新建 main.c CMakeList.txt
#include <stdio.h> int main(){ printf("Hello world from t1 Main! "); return 0; }
PROJECT (HELLO) SET(SRC_LIST main.c) MESSAGE(STATUS "This is BINARY dir " ${HELLO_BINARY_DIR}) MESSAGE(STATUS "This is SOURCE dir "${HELLO_SOURCE_DIR}) ADD_EXECUTABLE(hello SRC_LIST)