Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Modern CMake for C++

You're reading from   Modern CMake for C++ Effortlessly build cutting-edge C++ code and deliver high-quality solutions

Arrow left icon
Product type Paperback
Published in May 2024
Publisher Packt
ISBN-13 9781805121800
Length 502 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rafał Świdziński Rafał Świdziński
Author Profile Icon Rafał Świdziński
Rafał Świdziński
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. First Steps with CMake FREE CHAPTER 2. The CMake Language 3. Using CMake in Popular IDEs 4. Setting Up Your First CMake Project 5. Working with Targets 6. Using Generator Expressions 7. Compiling C++ Sources with CMake 8. Linking Executables and Libraries 9. Managing Dependencies in CMake 10. Using the C++20 Modules 11. Testing Frameworks 12. Program Analysis Tools 13. Generating Documentation 14. Installing and Packaging 15. Creating Your Professional Project 16. Writing CMake Presets 17. Other Books You May Enjoy
18. Index
Appendix

What this book covers

Chapter 1, First Steps with CMake, covers the installation of CMake, the use of its command line interface, and introduces the fundamental building blocks necessary for a CMake project.

Chapter 2, The CMake Language, cover the essential concepts of the CMake language, including command invocations, arguments, variables, control structures, and comments.

Chapter 3, Using CMake in Popular IDEs, emphasizes the importance of Integrated Development Environments (IDEs), guides you through selecting an IDE, and provides setup instructions for Clion, Visual Studio Code, and Visual Studio IDE.

Chapter 4, Setting up Your First CMake Project, will teach you how to configure a basic CMake project in its top-level file, structure the file tree, and prepare the toolchain necessary for development.

Chapter 5, Working with Targets, explores the concept of logical build targets, understand their properties and different types, and learn how to define custom commands for CMake projects.

Chapter 6, Using Generator Expressions, explains the purpose and syntax of generator expressions, including how to use them for conditional expansion, queries, and transformations.

Chapter 7, Compiling C++ Sources with CMake, delves into the compilation process, configure the preprocessor and optimizer, and discover techniques to reduce build time and improve debugging.

Chapter 8, Linking Executables and Libraries, understands the linking mechanism, different types of libraries, the One Definition Rule, the order of linking, and how to prepare your project for testing.

Chapter 9, Managing Dependencies in CMake, will teach you to manage third-party libraries, add CMake support for those that lack it, and fetch external dependencies from the internet.

Chapter 10, Using the C++20 Modules, introduces C++20 modules, shows how to enable their support in CMake, and configure the toolchain accordingly.

Chapter 11, Testing Frameworks, will help you understand the importance of automated testing, leverage built-in testing support in CMake, and get started with unit testing using popular frameworks.

Chapter 12, Program Analysis Tools, will show you how to automatically format source code and detect software errors during both build time and runtime.

Chapter 13, Generating Documentation, presents how to use Doxygen for automating documentation creation from source code and add styling to enhance your documentation’s appearance.

Chapter 14, Installing and Packaging, prepares your project for release with and without installation, create reusable packages, and designate individual components for packaging.

Chapter 15, Creating Your Professional Project, applies all the knowledge acquired throughout the book to develop a comprehensive, professional-grade project.

Chapter 16, Writing CMake Presets, encapsulates high-level project configurations into workflows using CMake preset files, making project setup and management more efficient.

Appendix - Miscellaneous Commands, serves as a reference for various CMake commands related to strings, lists, files, and mathematical operations.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image