建湖做网站哪家公司好学做效果图的网站有哪些
web/
2025/9/27 15:12:19/
文章来源:
建湖做网站哪家公司好,学做效果图的网站有哪些,clo3d代做网站,黄浦网站建设推广#x1f608;「CSDN主页」#xff1a;传送门 #x1f608;「Bilibil首页」#xff1a;传送门 #x1f608;「本文的内容」#xff1a;CMake入门教程 #x1f608;「动动你的小手」#xff1a;点赞#x1f44d;收藏⭐️评论#x1f4dd; 文章目录 1. 概述2. 使用方法2… 「CSDN主页」传送门 「Bilibil首页」传送门 「本文的内容」CMake入门教程 「动动你的小手」点赞收藏⭐️评论 文章目录 1. 概述2. 使用方法2.1 基本语法2.2 添加单个源文件2.3 添加多个源文件 3. 完整代码示例4. 实战使用技巧5. 注意事项6. 总结与分析 #mermaid-svg-odaxj9rBwRUSsIZb {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-odaxj9rBwRUSsIZb .error-icon{fill:#552222;}#mermaid-svg-odaxj9rBwRUSsIZb .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-odaxj9rBwRUSsIZb .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-odaxj9rBwRUSsIZb .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-odaxj9rBwRUSsIZb .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-odaxj9rBwRUSsIZb .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-odaxj9rBwRUSsIZb .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-odaxj9rBwRUSsIZb .marker{fill:#333333;stroke:#333333;}#mermaid-svg-odaxj9rBwRUSsIZb .marker.cross{stroke:#333333;}#mermaid-svg-odaxj9rBwRUSsIZb svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-odaxj9rBwRUSsIZb .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-odaxj9rBwRUSsIZb .cluster-label text{fill:#333;}#mermaid-svg-odaxj9rBwRUSsIZb .cluster-label span{color:#333;}#mermaid-svg-odaxj9rBwRUSsIZb .label text,#mermaid-svg-odaxj9rBwRUSsIZb span{fill:#333;color:#333;}#mermaid-svg-odaxj9rBwRUSsIZb .node rect,#mermaid-svg-odaxj9rBwRUSsIZb .node circle,#mermaid-svg-odaxj9rBwRUSsIZb .node ellipse,#mermaid-svg-odaxj9rBwRUSsIZb .node polygon,#mermaid-svg-odaxj9rBwRUSsIZb .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-odaxj9rBwRUSsIZb .node .label{text-align:center;}#mermaid-svg-odaxj9rBwRUSsIZb .node.clickable{cursor:pointer;}#mermaid-svg-odaxj9rBwRUSsIZb .arrowheadPath{fill:#333333;}#mermaid-svg-odaxj9rBwRUSsIZb .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-odaxj9rBwRUSsIZb .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-odaxj9rBwRUSsIZb .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-odaxj9rBwRUSsIZb .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-odaxj9rBwRUSsIZb .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-odaxj9rBwRUSsIZb .cluster text{fill:#333;}#mermaid-svg-odaxj9rBwRUSsIZb .cluster span{color:#333;}#mermaid-svg-odaxj9rBwRUSsIZb div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-odaxj9rBwRUSsIZb :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-odaxj9rBwRUSsIZb .default*{fill:#f9f!important;stroke:#333!important;stroke-width:2px!important;}#mermaid-svg-odaxj9rBwRUSsIZb .default span{fill:#f9f!important;stroke:#333!important;stroke-width:2px!important;} 开始CMake配置 使用add_executable 指定可执行文件名和源文件 单个源文件 多个源文件 创建可执行目标 设置目标属性 完成CMake配置 1. 概述
add_executable是CMake中用于添加可执行文件的基本命令。该命令将源代码文件编译成可执行程序是CMake项目中不可或缺的一部分。
2. 使用方法
2.1 基本语法
add_executable(executable_name [source1] [source2 ...])executable_name: 可执行文件的名称。[source1] [source2 ...]: 源代码文件列表。
2.2 添加单个源文件
add_executable(myApp main.cpp)2.3 添加多个源文件
add_executable(myApp main.cpp util.cpp util.h)3. 完整代码示例
以下是一个简单的示例演示了在CMake项目中如何使用add_executable来创建一个简单的可执行程序。 项目结构 cssCopy codeMyProject/
├── CMakeLists.txt
└── src/├── main.cpp└── util.cppCMakeLists.txt cmake_minimum_required(VERSION 3.10)
project(MyApp)add_executable(myApp src/main.cpp src/util.cpp)src/main.cpp #include iostream
#include util.hint main() {std::cout Hello, CMake! std::endl;printUtil();return 0;
}src/util.cpp #include util.h
#include iostreamvoid printUtil() {std::cout Utility function. std::endl;
}4. 实战使用技巧
源文件管理对于大型项目使用变量或源文件列表来管理多个源文件。条件编译根据不同条件如平台或配置添加不同的源文件或定义。目标属性设置使用target_*命令设置可执行目标的属性如target_include_directories设置包含目录。
5. 注意事项
文件路径确保源文件的路径正确无误。可执行文件命名避免与系统命令或其他项目中的可执行文件冲突。跨平台兼容性考虑源代码在不同平台上的兼容性。
6. 总结与分析
add_executable命令是CMake项目中构建可执行程序的基石。通过合理使用此命令可以灵活地管理源代码文件并生成所需的可执行目标。了解和掌握add_executable的使用是每个使用CMake的开发者必备的技能。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/82830.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!