## 只有1个源文件 ##
文件结构: —-main.cpp —-CMakeLists.txt
main.cpp,代码如下:
#include<iostream>
using namespace std;
int main()
{
int base,exponent;
cin>>base>>exponent;
cout<<base*exponent<<endl;
return 0;
}
CmakeLists.txt的编写,代码如下:
# CMake 最低版本要求
cmake_minimum_required (VERSION
2.8)
# 项目名称
project (Demo1)
# 指定生成目标
add_executable(Demo main.cpp)
转载请注明原文地址: https://ju.6miu.com/read-662458.html