Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the authors
OK
Modern CMake for C++: Effortlessly build cutting-edge C++ code and deliver high-quality solutions
Purchase options and add-ons
Gain proficiency in CMake and unlock the complete potential of C++ to develop exceptional projects
Get With Your Book: PDF Copy, AI Assistant, and Next-Gen Reader Free
Key Features
- Get to grips with CMake and take your C++ development skills to enterprise standards
- Use hands-on exercises and self-assessment questions to lock-in your learning
- Understand how to build in an array of quality checks and tests for robust code
Book Description
Modern CMake for C++ isn't just another reference book, or a repackaging of the documentation, but a blueprint to bridging the gap between learning C++ and being able to use it in a professional setting. It's an end-to-end guide to the automation of complex tasks, including building, testing, and packaging software.
This second edition is significantly rewritten, restructured and refreshed with latest additions to CMake, such as support of C++20 Modules.
In this book, you'll not only learn how to use the CMake language in CMake projects but also discover how to make those projects maintainable, elegant, and clean. As you progress, you'll dive into the structure of source directories, building targets, and packages, all while learning how to compile and link executables and libraries. You'll also gain a deeper understanding of how those processes work and how to optimize builds in CMake for the best results. You'll discover how to use external dependencies in your project – third-party libraries, testing frameworks, program analysis tools, and documentation generators. Finally, you'll gain profi ciency in exporting, installing, and packaging for internal and external purposes.
By the end of this book, you'll be able to use CMake confi dently at a professional level.
What you will learn
- Understand best practices to build ++ code
- Gain practical knowledge of the CMake language
- Guarantee code quality with tests and static and dynamic analysis
- Discover how to manage, discover, download, and link dependencies with CMake
- Build solutions that can be reused and maintained in the long term
- Understand how to optimize build artifacts and the build process
- Program modern CMake and manage your build processes
- Acquire expertise in complex subjects such as CMake presets
Who this book is for
The book is for build engineers and software developers with knowledge of C/C++ programming who are looking to learn CMake to automate the process of building small and large software solutions. If you’re just getting started with CMake, a long-time GNU Make user, or simply looking to brush up on the latest best practices, this book is for you.
Table of Contents
- First Steps with CMake
- The CMake Language
- Using CMake in Popular IDEs
- Setting Up Your First CMake Project
- Working with Targets
- Using Generator Expressions
- Compiling C++ Sources with CMake
- Linking Executables and Libraries
- Managing Dependencies in CMake
- Using the C++20 Modules
- Testing Frameworks
- Program Analysis Tools
- Generating Documentation
- Installing and Packaging
- Creating Your Professional Project
- Writing CMake Presets
- Appendix
- ISBN-101805121804
- ISBN-13978-1805121800
- Edition2nd ed.
- PublisherPackt Publishing
- Publication dateMay 28, 2024
- LanguageEnglish
- Dimensions7.5 x 1.14 x 9.25 inches
- Print length502 pages
Frequently bought together

Customers who viewed this item also viewed
- Modern C++ Programming Cookbook: Master Modern C++ with comprehensive solutions for C++23 and all previous standardsPaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Monday, Sep 21
- C++ Memory Management: Write leaner and safer C++ code using proven memory-management techniquesPaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Monday, Sep 21
- Tour of C++, A (C++ In-Depth Series)PaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- C++ Software Design: Design Principles and Patterns for High-Quality SoftwarePaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Asynchronous Programming with C++: Build blazing-fast software with multithreading and asynchronous programming for ultimate efficiencyPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
- C++ High Performance: Master the art of optimizing the functioning of your C++ code, 2nd EditionPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
Customers also bought or read
- Modern C++ Programming Cookbook: Master Modern C++ with comprehensive solutions for C++23 and all previous standards
Paperback$26.53$26.53Delivery Mon, Sep 21 - C++ Memory Management: Write leaner and safer C++ code using proven memory-management techniques
Paperback$29.99$29.99Delivery Mon, Sep 21 - Asynchronous Programming with C++: Build blazing-fast software with multithreading and asynchronous programming for ultimate efficiency
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - C++ High Performance: Master the art of optimizing the functioning of your C++ code, 2nd Edition
Paperback$59.99$59.99FREE delivery Mon, Sep 21 - Bare-Metal Embedded C Programming: Develop high-performance embedded systems with C for Arm microcontrollers
Paperback$31.91$31.91Delivery Mon, Sep 21 - C++ Software Design: Design Principles and Patterns for High-Quality Software
Paperback$51.24$51.24FREE delivery Sat, Sep 19 - Hands-On Machine Learning with C++: Build, train, and deploy end-to-end machine learning and deep learning pipelines
Paperback$38.54$38.54FREE delivery Mon, Sep 21 - C++ in Embedded Systems: A practical transition from C to modern C++#1 Best SellerComputer Hardware Design
Paperback$29.99$29.99Delivery Sep 20 - 21 - Programming: Principles and Practice Using C++ (C++ In-depth)#1 Best SellerC++ Programming Language
Paperback$56.72$56.72FREE delivery Sat, Sep 19 - Beginning C++ Game Programming: Learn C++ from scratch by building fun games
Paperback$29.99$29.99Delivery Mon, Sep 21 - The Art of Writing Efficient Programs: An advanced programmer's guide to efficient hardware utilization and compiler optimizations using C++ examples
Paperback$39.59$39.59FREE delivery Mon, Sep 21 - CMake Best Practices: Upgrade your C++ builds with CMake for maximum efficiency and scalability
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14
Paperback$44.37$44.37FREE delivery Sep 27 - Oct 14 - GPU Programming with C++ and CUDA: Uncover effective techniques for writing efficient GPU-parallel C++ applications
Paperback$44.99$44.99FREE delivery Mon, Sep 21 - Mastering C++ Game Animation Programming: Enhance your skills with advanced game animation techniques in C++, OpenGL, and Vulkan
Paperback$26.99$26.99Delivery Mon, Sep 21 - Managing Projects with GNU Make: The Power of GNU Make for Building Anything (Nutshell Handbooks)
Paperback$20.11$20.11Delivery Sat, Sep 19 - Writing a C Compiler: Build a Real Programming Language from Scratch
Paperback$42.43$42.43FREE delivery Sat, Sep 19 - Minimal CMake: Learn the best bits of CMake to create and share your own libraries and applications
Paperback$43.99$43.99FREE delivery Mon, Sep 21 - Systems Performance (Addison-Wesley Professional Computing Series)#1 Best SellerComputer Performance Optimization
Paperback$57.41$57.41FREE delivery Sat, Sep 19 - LLVM Code Generation: A deep dive into compiler backend development
Paperback$34.99$34.99Delivery Mon, Sep 21 - Making Embedded Systems: Design Patterns for Great Software#1 Best SellerComputer Hardware Embedded Systems
Paperback$32.74$32.74Delivery Sat, Sep 19
From the brand
-
See Our Full Range
-
Packt is a leading publisher of technical learning content with the ability to publish books on emerging tech faster than any other.
Our mission is to increase the shared value of deep tech knowledge by helping tech pros put software to work.
We help the most interesting minds and ground-breaking creators on the planet distill and share the working knowledge of their peers.
From the Publisher
What’s new in this edition?
This edition has been thoroughly rewritten to simplify and reorder the content to offer you the best learning experience. The chapters have been updated to include changes in CMake from versions 3.20 to 3.26.
This edition also includes three completely new chapters on C++20 modules, IDEs supported by CMake, and writing CMake presets. Cutting-edge best practices have been newly integrated throughout the book, while retaining legacy methods that are still in use in the industry.
What's your favorite part in the book?
This book carefully covers all subjects relevant to C++ projects, but one part stands out—automated testing with CMake. C++ projects require certain considerations when testing, and this book addresses them thoroughly. You will learn how to structure the project files, lay out and configure targets for smooth automated testing, and enable additional program analysis using a non-obstructive approach.
How does this book differ from other books on CMake and C++?
It is pragmatic. This book explains how fundamental principles are applied for practical purposes in an opinionated manner. Unlike other books, it covers all aspects of building real-life projects—how to structure, build, test, package, document, and install your solution in a way that makes all pieces of this complex process fit together coherently and enables the growth of the project.
How does the book help build engineers become proficient in CMake and unlock the true potential of C++?
Tools should solve your problems, not generate unnecessary boilerplate and complexity. CMake is the perfect solution for many build engineers, but it is often explained the wrong way. This book will first show you how users approach CMake and then provide you with enough basics of the language to prevent you from making simple mistakes. Now the real fun can begin—we will tackle all the aspects of the software development lifecycle with practical examples, just like in the real world. You’ll not only understand how to perform testing, program analysis, debugging, packaging, and documentation, but also see why these are important and how they affect all the other elements of the project.
Editorial Reviews
About the Author
Rafał Świdziński, a seasoned staff engineer at Google, boasts over 12 years of full-stack development expertise. With a track record of spearheading projects for industry giants like Cisco Meraki, Amazon, and Ericsson, he embodies a commitment to innovation. As a Londoner by choice, he remains at the forefront of technological progress, engaging in a myriad of personal ventures. His recent pivot toward AI in healthcare refl ects his dedication to impactful advancements. Rafał values top-notch code quality and craftsmanship, sharing insights through his YouTube channel and published books.
Product details
- Publisher : Packt Publishing
- Publication date : May 28, 2024
- Edition : 2nd ed.
- Language : English
- Print length : 502 pages
- ISBN-10 : 1805121804
- ISBN-13 : 978-1805121800
- Item Weight : 1.89 pounds
- Dimensions : 7.5 x 1.14 x 9.25 inches
- Best Sellers Rank: #223,816 in Books (See Top 100 in Books)
- #7 in Compiler Design
- #8 in Software Programming Compilers
- #45 in C++ Programming Language
- Customer Reviews:
About the authors

Rafał Świdziński, a seasoned staff engineer at Google, boasts over 12 years of full-stack development expertise. With a track record of spearheading projects for industry giants like Cisco Meraki, Amazon, and Ericsson, he embodies a commitment to innovation. As a Londoner by choice, he remains at the forefront of technological progress, engaging in a myriad of personal ventures. His recent pivot toward AI in healthcare reflects his dedication to impactful advancements. Rafał values top-notch code quality and craftsmanship, sharing insights through his YouTube channel and published books.

Discover more of the author’s books, see similar authors, read book recommendations and more.




















![NMLS Study Cards: NMLS MLO Test Prep 2026-2027 for the SAFE Mortgage Loan Originator Exam with Practice Test Questions [Full Color Cards]](https://m.media-amazon.com/images/I/31MkL3cXK0L._AC_SR100,100_QL65_.jpg)
