C++版本使用CMakeLists.txt编译(单个源文件)可执行文件
# 0.目录结构
[root@localhost CMakeLists]# ls
CMakeLists.txt main.cpp
# 1.创建C++代码main.cpp
[root@localhost CMakeLists]# cat main.cpp
/*!
* * Copyright (c) 2020,ZYF.
* * All Rights Reserved.
* *
* * \file main.cpp
* * \brief C++版本使用CMakeLists.txt编译可执行文件
* *
* * \author ZYF
* * \date 2020/7/11 10:58:42
* * \version 1.0.0
* */
#include <iostream>
using namespace std;
void Test()
{
std:cout << "C++版本使用CMakeLists.txt编译可执行文件。" << std::endl;
};
int main(int argc, char* argv[])
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载