-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Minimal CMake
By :
We are thrilled you’ve decided to pick up Minimal CMake to either get introduced to CMake or to expand your knowledge of what is possible with it today. If you are interested in learning about how CMake can help you create libraries and applications, integrate with world-class open source software, or how it can be used to share your creations with others, you’re in the right place.
The title of this book is a little tongue-in-cheek, but the idea is to get to the good bits of CMake as fast as possible, skipping over some areas and avoiding others entirely. CMake is at its best when it does what you need it to do, and then gets out of your way. You don’t need to be a CMake expert to wield it effectively, and whether you’re new to CMake or have been away a while and are returning to see what’s changed, this book will have something for you.
An important aspect of this book is its focus on practical examples. It will take you step by step from a simple console application, all the way through to a full windowed app that runs on macOS, Windows, and Linux. Each chapter builds on the last, and every chapter is accompanied by source code split into multiple parts, each incrementally building on what came before. You will witness step by step how the journey unfolds and the reasoning and trade-offs behind every change.
In Part 1, we’ll make sure everyone has the tools they need to get CMake set up on their system of choice. We’ll then walk through some simple CMake scripts to get familiar with the most fundamental CMake commands. Next, we’ll turn our attention to a relatively new and incredibly powerful addition to CMake that makes integrating external libraries trivial. As well as showing how to integrate external code, we’ll show you how to make your own code sharable by creating a reusable library ourselves.
Part 2 builds on the foundations laid by Part 1. We’ll start by introducing some incredibly useful quality-of-life improvements that have been added to CMake in recent years. These eliminate a lot of tedious commands while keeping our CMake scripts clean and simple. We’ll also start to introduce larger dependencies and understand strategies for how to handle them, as well as how to create them ourselves. We’ll wrap things up by showing how to create a unified build that can configure and build our application, libraries, and dependencies all with a single command.
In Part 3, we’ll cover some other important areas where CMake can help us build and share better software. We’ll see how to add many kinds of tests to both our libraries and applications, as well as how to tie them together with the help of the companion tool, CTest. We’ll also gain an appreciation for how CMake can help us package our application, so it runs not just on our machine, but anywhere. We’ll wrap things up by reviewing what other great tools are available that can make working with CMake easier, and where to go next to continue building your CMake knowledge.