2018년 3월 29일 목요일

cmake

cmake


소개 


cross-platform 빌드 및 테스트, 패키징 프로그램
빌드 수행하는 host machine 에서 수행 가능한 빌드 시스템 생성 방식

생성 가능한 빌드 시스템들


cmake


tutorial



Hello World


준비물


CMakeLists.txt:

project (hello)
add_executable (hello hello.c)


hello.c:

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    printf("hello\n");
    return 0;
}


빌드


$ mkdir build
$ cd build
$ cmake ..
$ make

실행


$ ./hello
hello



예제 소스 (github)



댓글 없음:

댓글 쓰기