{"id":13438440,"url":"https://github.com/SFUMECJF/cmake-examples-Chinese","last_synced_at":"2025-03-20T06:30:25.833Z","repository":{"id":38400658,"uuid":"301707249","full_name":"SFUMECJF/cmake-examples-Chinese","owner":"SFUMECJF","description":"快速入门CMake,通过例程学习语法。在线阅读地址：https://sfumecjf.github.io/cmake-examples-Chinese/","archived":false,"fork":false,"pushed_at":"2022-11-28T04:15:56.000Z","size":142726,"stargazers_count":2380,"open_issues_count":12,"forks_count":358,"subscribers_count":21,"default_branch":"main","last_synced_at":"2024-10-28T00:23:00.257Z","etag":null,"topics":["cmake","cmake-examples"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SFUMECJF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-06T11:41:09.000Z","updated_at":"2024-10-27T13:21:10.000Z","dependencies_parsed_at":"2022-07-14T08:49:34.412Z","dependency_job_id":null,"html_url":"https://github.com/SFUMECJF/cmake-examples-Chinese","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFUMECJF%2Fcmake-examples-Chinese","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFUMECJF%2Fcmake-examples-Chinese/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFUMECJF%2Fcmake-examples-Chinese/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFUMECJF%2Fcmake-examples-Chinese/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SFUMECJF","download_url":"https://codeload.github.com/SFUMECJF/cmake-examples-Chinese/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244564784,"owners_count":20473129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cmake-examples"],"created_at":"2024-07-31T03:01:05.541Z","updated_at":"2025-03-20T06:30:20.812Z","avatar_url":"https://github.com/SFUMECJF.png","language":"C++","funding_links":[],"categories":["C++","CMake"],"sub_categories":[],"readme":"\u003ctable border=\"0\" width=\"10%\" align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/1.jpg\" height=\"80\" width=\"82\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/2.jpg\" height=\"80\" width=\"82\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/3.jpg\" height=\"80\" width=\"82\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/4.jpg\" height=\"80\" width=\"82\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img.shields.io/github/stars/SFUMECJF/cmake-examples-Chinese.svg?style=social\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/6.jpg\" height=\"82\" width=\"82\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n   \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/7.jpg\" height=\"82\" width=\"82\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/8.jpg\" height=\"82\" width=\"82\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://img1.github.io/tmp/9.jpg\" height=\"82\" width=\"82\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/vuejs/vue\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/ubuntu-1604/1804/2004-brightgreen.svg\" alt=\"ubuntu\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/vuejs/vue-router\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Language-C++--shell-brightred.svg\" alt=\"vue-router\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/vuejs/vuex\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/学习方式-在线阅读-brightgreen.svg\" alt=\"vuex\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e  \n\n\n仓库受到的关注度越来越高，考虑到大家学习容易出现问题，现在创建一个qq交流群：433323162。微信群可以扫码加入。    \n\n\n# cmake-examples-Chinese\n\n项目在线阅读电子书地址：[通过例子学习CMake](https://sfumecjf.github.io/cmake-examples-Chinese/)\n\n本教程全部采用中文，通过一个个例子帮助读者由浅入深逐渐理解CMake的语法。教程主要来源于github优秀CMake项目，项目贡献者在翻译中，又查阅CMake官方手册，或者与已经工作的C++开发者交流，对于模糊的地方予以详细说明。\n\n非常适合完全没接触过CMake以及shell的人从头阅读。\n\n另外，在部署过程中，main分支的代码会比在线电子书的更新进度快，因为页面部署总是出现问题。最近打算弃用部署页面的`gitbook`工具（它已经过时了，过时至少2年）。\n\n\n**觉得有用的话，希望给个star哦～**\n##  什么是cmake\nCMake是一个跨平台的安装（编译）工具，可以用简单的语句来描述所有平台的安装(编译过程)。他能够输出各种各样的makefile或者project文件，CMake 的组态档取名为 CMakeLists.txt。也就是在CMakeLists.txt这个文件中写cmake代码。\n一句话：cmake就是将多个cpp、hpp文件组合构建为一个大工程的语言。\n\n##  本cmake系列介绍\n首先大家学习cmake一定会遇到《cmake practice》这本书，但是纯粹讲理论，如果没有实践的话是学不会的。\u003cmark\u003elearning by doing\u003c/mark\u003e是学习各种知识的不二法门。\n\n另外，在不太大的工程中，其实cmake也不需要钻研到多深入，日后工作用得多了自然就会了。比如说PRIVATE、INTERFACE、PUBLIC这三个参数在实际中的用途，当时请教了wps的一位前辈，最终的理解在这篇文章中[cmake-scope](https://github.com/SFUMECJF/cmake-examples-Chinese/blob/main/CMake-scope.md)。他自己也是偶尔有一次用这三个参数测试了一下，其他时候不怎么关心。\n\n而如果作为在校学生，花费很多时间钻这块内容，不实践也很快会忘掉。所以，基本上cmake写出来，能用就行，学习阶段不要钻牛角尖，工作了再钻研。\n\n如果想要快速入门，直接学习`01-basic`即可，学完就可以动手编写自己的工程了。有时间可以学习`02-sub-projects`以及`03-code-generation`。\n\n另外，大家学习CMake的主要目的还是用于实操，所以本文作者在第4个文件夹`实践案例`中提供了使用CMake包含`Open CV`,`dcmtk`, `qt`的CMake工程，大家可以直接下载使用，根据里面的readme进行初步配置。如果遇到错误可以告诉我，我来修改。\n\n## 学习途径\n\n推荐在线阅读该电子书，快速过一遍知识点。\n\n时间充足想打基础的人，可以结合[原项目例子](https://github.com/ttroy50/cmake-examples)，在Linux系统下载运行代码。当遇到有疑问的地方，查阅本项目手册。\n\n\n\n点个star以后，直接将本github克隆到本地或者fork,欢迎PR。\n\n```shell\ngit clone https://github.com/SFUMECJF/cmake-examples-Chinese.git\n```\n##  微信公众号\n最后，博主也只是一个初学者罢了，只是把自己学习过程中的东西做了总结，如果大家有什么想法，欢迎指正。我的微信公众号如下：\n现阶段主要总结计算机视觉知识：Qt，C++，CMake,OpenCV等等\n公众号名称：三丰杂货铺\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20200529103009878.gif#pic_center)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSFUMECJF%2Fcmake-examples-Chinese","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSFUMECJF%2Fcmake-examples-Chinese","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSFUMECJF%2Fcmake-examples-Chinese/lists"}