- sayHello.cpp
- CMakeLists.txt
sayHello.cpp
#include <iostream>
int main()
{
std::cout << "Hello world" << std::endl
}
int main()
{
std::cout << "Hello world" << std::endl
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(sayHello)
add_executable(sayHello, sayHello.cpp)
編譯方式
$ mkdir build
$ cd build
$ cmake ..
編譯完成後即可在build資料夾下找到sayHello執行檔
$ cd build
$ cmake ..
沒有留言:
張貼留言