Shortcut Your Path to Building C++ Code like a Pro
CMake is a powerful build tool for C/C++, but can be an absolute pain to use. Scouring the internet for hours each time you need to modify your CMakelists.txt file is no fun. Even worse, you often end up learning the “wrong” (old) way of doing things. There are a lot of old CMake tutorials and examples out there…
The “Learn Modern CMake by Example” book/course will save you hours of time and frustration, by teaching you the correct (modern) ways to perform the most common build tasks.
Deliberately Short & Focused on Results
The CMake Tutorial is deliberately short, and focused sharply on making CMake do what you need it to. It doesn’t cover every nook and cranny (of CMake), nor does it bog you down with endless theory and backstory. Your time is valuable, so it’s designed to get you up and running quickly.
No drowning you with details on every single CMake feature (that’s what the official documentation is for). It’s got only the bits you’re most likely to need, which have been organized for fast learning.
What You’ll Learn in The CMake Tutorial
- CMakeLists.txt files & how CMake works
- Compiling multiple source files into one program
- Using third-party libraries
- Using non-CMake third-party libraries
- Using pre-compiled third-party libraries
- Choosing the C++ standard version, and other settings
- Setting per-compiler flags
- Creating static and dynamic libraries
- Compiling debug and release versions
- Tackling larger projects (multi-directory)
Meet the Author – Hans de Ruiter
That all changed when a project forced me to try CMake again. To my pleasant surprise, modern CMake was a lot better. It was easier to use, and both the errors and documentation were easier to understand.
The learning curve is still on the steep side, especially with a large volume of outdated tutorials out there. So, I’ve taken the time to learn the right way to learn modern CMake.
I created this book/course because I didn’t find a resource to quickly learn the essentials of modern CMake.
Steven Broshar (verified owner) –
Covers some of the most common use cases for CMake and even gets into relatively complex builds such as integrating non-CMake external builds. The information is consistently structured and easy to follow. Good for someone who is just beginning to use CMake and for folks with modest experience. Most useful tip: cmake .. –trace-source=CMakeLists.txt
Couldn’t give 5 stars since it lacks depth in many aspects such as command line options, design theory of CMake, how to debug difficult CMake build issues. I’ve gone thru several other CMake tutorials and this is the best one! On a scale relative to other CMake tutorials, it is 5-star. But I have high standards and can imagine something better.
Hans de Ruiter –
Thanks for the feedback. With tutorials getting the balance between difficulty and depth of information can be challenging. Depth means more information, and too much can quickly overwhelm people (esp. beginners), which in results in people giving up and therefore not getting much value out of the tutorial. This is why I lean toward just the details that readers/students are most likely to need. I also try to provide references to where more in-depth information can be found for those who need them.
I’ll keep your feedback in mind when I next review/revise the tutorial.
Kurt Geisel (verified owner) –
Hans did his homework like no other on this. I’ve seen a lot of bootstrapping materials on CMake and believe me, nothing comes close to bringing you to the level of understanding that this does. This is hands-down the best CMake tutorial out there, and unlike many, it puts it in full context of the many alternatives. If you need to understand CMake, I highly recommend this.
emeck (verified owner) –
This is what a beginner in C/C++ like me needs. I haven’t finish the ebook but so far I find it very easy to understand what are the example about and also got the examples working both under Linux and MorphOS. Hopefully soon I’ll try also under AmigaOS. Thanks!