Book Review: Modern CMake for C++

Book Review: Modern CMake for C++ (Second Edition) by Rafał Świdziński

As a CMake developer and user for over 15 years, with personal contributions to the project, I am thoroughly impressed by “Modern CMake for C++” by Rafał Świdziński. This book stands out for its methodical approach to utilizing CMake, providing a comprehensive guide to setting up project layouts, and detailing how CMake handles various types of build targets.

Before the widespread adoption of CMake, maintaining makefiles, Visual Studio solution files, and build scripts for different compilers, platforms, and IDEs was cumbersome and error-prone. The advent of CMake has simplified this significantly, establishing itself as the de facto standard in the C++ community. Świdziński’s book captures this transition beautifully, emphasizing best practices that avoid the common pitfalls of using CMake ineffectively, which can add unnecessary complexity to projects.

CMake is a tool that is easy to use for small and large projects alike. However, realizing its full potential necessitates adherence to best practices.

One of the book’s greatest strengths is its ability to cater to both beginners and seasoned developers. For those new to CMake, it offers a clear and accessible introduction, while providing advanced insights for experienced users. The author’s methodological guidance on using CMake correctly makes this book valuable, ensuring readers can wield this powerful tool effectively. For the seasoned developer, this book will be an excellent resource to help you build technical capital!

I particularly appreciated the sections on integrating CMake with C++20 modules, which is crucial for staying current with modern C++ standards. Beyond just building applications, the book also covers using CMake for testing, analytics, packaging, and deployment, showcasing its versatility and comprehensive nature.

In Modern CMake for C++, Świdziński’s pragmatic approach, using real-world examples and best practices, ensures that the concepts are understood and easily applied to actual projects. “Modern CMake for C++” is an indispensable tool for any C++ developer aiming to master CMake and streamline their build processes. Whether you are new to CMake or have been using it for years, this book is an excellent example of leveraging it to its fullest potential.

In summary, “Modern CMake for C++” is a must-read for developers looking to enhance their C++ development skills with robust, maintainable, and scalable build configurations. It’s a testament to how far the C++ community has come, and a guide to where it is headed, with CMake leading the way.

Be sure to check out my C++ book!

Check out my book: Data Structures and Algorithms with the C++ STL: A guide for modern C++ practitioners. This is a great companion to Modern CMake for C++!


Discover more from John Farrier

Subscribe to get the latest posts sent to your email.

Leave a Reply

Discover more from John Farrier

Subscribe now to keep reading and get access to the full archive.

Continue reading