1 Star 0 Fork 2

baizg1107 / KevinCmake

forked from 吴刁 / KevinCmake 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Cmake 学习

参考文章: https://blog.csdn.net/o_0ava0_o/article/details/124740167

1、安装

  • 如果安装了Qt5.14.2,就不用安装gcc

地址: C:\Qt\Qt5.14.2\Tools\mingw730_64\bin

  • 把地址加入到环境变量里面
  • 再打开cmd 运行:
gcc -v
  • launch.json配置相对路径:

gdb程序所在路径,前面的路径就是我们配置环境变量的路径

"miDebuggerPath": "gdb.exe",	

task.json:

"command": "g++", //g++命令

2、项目介绍

2.1 hello_world

用VS Code的C++配置进行编译的简单项目

2.1 hello_cmake

手动写的一个简单的Cmake项目

2.2 cmake_qt

添加一个用QtCreator初始化的Cmake项目

2.3 cmake_group

一个EXE调用一个DLL的示例

3、坑

  • 设定路径后,要重启vscode,才可能生效。
  • <> 头文件不能加.h
#include <iostream.h> //不过
#include <iostream> //通过

还有一种是:gcc没有这个头文件。

4、正则

  • 搜索图片,添加别名
<file>images/(.*)</file>
<file alias ="$1">images/$1</file>
  • 正则替换文件头的注释
搜索:
/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*/
替换:
/**
 * @license     MIT
 * @author      Kevin
*/
MIT License Copyright (c) 2022 Kevin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

用于学习C++和Cmake、QT等编译的项目 展开 收起
C++
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/bzg1107/KevinCmake.git
git@gitee.com:bzg1107/KevinCmake.git
bzg1107
KevinCmake
KevinCmake
master

搜索帮助