C++版本使用CMakeLists.txt编译(单个源文件)可执行文件
0.目录结构
[root@localhost CMakeLists]# tree
.
├── CMakeLists.txt
└── main.cpp
0 directories, 2 files
[root@localhost CMakeLists]#
1.创建C++代码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