CMake Tutorial Guide
Author: Qiang Ge
2020-05-06 22:17:25
Table of Contents
Manual Documentation
Offline Compilation
Online Installation
Online Tutorials
Community Wiki
G4 (ROOT) Related
Videos
Books
Presentation Slides
Code Exercises or Demos
Summary
Using CMake as a cross-platform project management tool for resource configuration management in G4, which is based on C++, is a very wise choice. Whether learning G4 or in future work, CMake and Git will be important aids. Some students have mentioned wanting to see tutorials, so this article roughly describes reference materials related to learning CMake.
If you need to open links, please click on “Read the Original” at the bottom left. Due to the current inability of the subscription account to support external links, all hyperlinks are invalid, and this article has been converted to PDF and uploaded to the cloud drive.
Manual Documentation
If you are using Linux, remember to install cmake-doc when installing CMake. Otherwise, you can compile the HTML version of CMake yourself. After all, it is quite difficult to access the CMake official website without a proxy server.
Offline Compilation
The compilation method can refer to “CMake Brief User Guide – ChrisZZ – Blog Garden”, click link. The original CMake documentation is in Rust version; for convenience, it can be compiled into LaTeX version or HTML version, etc.

Online Installation
Installation method under Ubuntu

Online Tutorials
Community Wiki
Official wiki link.
There is also a similar link.
Quick General Tutorial One
The first tutorial link. It mentions part of the content from the official wiki above, with a link on how to convert from qmake to CMake.
There is also a quick tutorial that claims to teach you in 15 minutes, which can be useful for beginners, click link.
G4 (ROOT) Related
Information related to using ROOT with CMake, click link.
Videos
There are mainly four videos, all downloaded from U2B a long time ago, see the cloud drive at the end of the article.
Books
(1) CMake Practice
(2) CMake Rules
(3) Mastering CMake
(4) CMake Cookbook, which can also be viewed online, click link. Or link1, link2.
Also available on Baidu Cloud Drive.
Presentation Slides
The first is from the cppcon conference, titled “Using Modern CMake Patterns to Enforce a Good Modular Design”.
The second is from ROOT, named “ROOTwithCMake-20130311.pdf”.
Also available on Baidu Cloud Drive.
Code Exercises or Demos
The first exercise clicklink1 or link2 (domestic code hosting platform, Gitee)
A collection of CMake application projects, click link.
CMake examples, click link.
Summary
In short, it is essential to practice more in projects; only with demand is there motivation. The author continuously fills in the gaps during the project process. All links in this article may not be guaranteed to open over time, and some links may require a network proxy to access.
Cloud drive sharing, click bottom “Read the Original”, extraction code: 7xmk.