I think that "Modern CMake for C++" is the most comprehensive, exhaustive, and up-to-date resource available on CMake.
The book is aimed at both beginners and experienced developers. It is highly thorough as it starts with basic topics such as the fundamentals of the CMake language and the installation of necessary tools (I particularly appreciated the Docker image provided with everything needed) and then progresses to more advanced topics like dependency management, configuring code analysis tools, testing frameworks, and creating presets.
Why is it useful? Programming in C++ is already complex, and managing large projects is even more so, especially when considering the various issues related to build processes and distribution. In this book, you can clearly see how the author's experience and skills in this field come in handy for solving well-known problems.
What I particularly appreciated is the practical approach with which it is written: the examples provided are based on real-world project scenarios. Furthermore, one of the author's stated goals (which I believe has been fully achieved) is to illustrate modern and efficient techniques instead of the "established" but outdated and obsolete ones.
If I were to express any doubts, as a beginner, I did struggle a bit with some topics, likely due to my own gaps in knowledge, but a bit of deeper study was enough to overcome them.
In conclusion, I highly recommend this book for its practicality, completeness, and modern approach. Nowadays, knowing and mastering C++ is not enough to successfully distribute professional projects, which are constantly growing in size. "Modern CMake for C++" has been an invaluable aid in this journey and is, I would say, essential for anyone looking to master CMake and improve their workflow in C++ software development.
I recently read Modern CMake for C++, Second Edition and was thoroughly impressed. Despite considering myself highly technical and knowledgeable in CMake, I still learned a plethora of new information. The book covers a wide range of topics, from debugging a CMake project, understanding the grammar, targets, and package management like FetchContent, to using CMake in advanced IDEs.
One of the standout aspects of this book is its guidance on properly setting up a project. It emphasizes good practices, what to focus on when building a project, the hierarchy, and various gotchas to avoid. The book even delves into the linking models of C and C++ and how to handle them correctly in CMake.
This book is a must-read for every developer using CMake. By following the rules and best practices outlined, it will make your project healthier. Regardless of your experience level, you are bound to pick up new skills. The format and organization of this book are simply fabulous, making it highly recommended.