CMake —— 跨平台 编译 软件 & visual studio支持
CMake is an open-source, cross-platform family of tools designed to build, test and package software.
CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK.
https://en.wikipedia.org/wiki/CMake
在软件开发方面,CMake是一个跨平台的 免费和开源软件,用于构建自动化、测试、打包和安装软件,使用独立于编译器的方法。[3] CMake 本身并不是一个构建系统;它生成另一个系统的构建文件。它支持目录层次结构和依赖于多个库的应用程序。它与原生构建环境结合使用,例如Make、Qt Creator、Ninja、Android Studio、Apple 的Xcode和Microsoft Visual Studio。它具有最小的依赖关系,只需要在自己的构建系统上 使用C++编译器。
CMakeLists.txt [编辑]
CMake 具有相对简单的解释性命令式脚本语言。它支持变量、字符串操作方法、数组、函数/宏声明和模块包含(导入)。CMake 语言命令(或指令)cmake
从名为CMakeLists.txt
. 此文件指定源文件和构建参数,CMake 将它们放置在项目的构建规范(例如 Makefile)中。此外,.cmake
-suffixed 文件可以包含 CMake 使用的脚本。[20]
要生成项目的构建文件,cmake
请在终端中调用并指定包含CMakeLists.txt
. 该文件包含一个或多个 . 格式的命令COMMAND(argument ...)
。
https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170
Visual Studio 对 CMake 的本机支持使您能够在 Windows、Linux 的 Windows 子系统 (WSL) 以及来自同一 Visual Studio 实例的远程系统上编辑、构建和调试 CMake 项目。Visual Studio 直接使用CMake 项目文件(例如CMakeLists.txt
)用于 IntelliSense 和浏览。cmake.exe
由 Visual Studio 直接调用以进行 CMake 配置和构建。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?
2019-10-28 React之概述(待续)
2019-10-28 React之简介
2019-10-28 Vue.js学习之简介(待续)
2019-10-28 Build Telemetry for Distributed Services之OpenCensus:Tracing2(待续)