CMake study notes 01

Cmake的HelloWorld

In the folder, while New main.c CMakeList.txt

#include <stdio.h>
int main(){
    printf("Hello world from t1 Main!\n");
    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)

 

Guess you like

Origin www.cnblogs.com/sailifsh-lyh/p/10983628.html