CMake Best Practices Upgrade Your C++ Builds with CMake for Maximum Efficiency and Scalability
Discover the cutting-edge advancements in CMake with the new edition of CMake Best Practices. This book focuses on real-world applications and techniques to leverage CMake, avoiding outdated hacks and overwhelming documentation. You’ll learn how to use CMake presets for streamlined project configura...
Autor principal: | |
---|---|
Otros Autores: | |
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing, Limited
2024.
|
Edición: | 2nd ed |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009845438906719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Dedications
- Contributors
- Table of Contents
- Preface
- Part 1
- The Basics
- Chapter 1: Kickstarting CMake
- Technical requirements
- CMake in a nutshell
- Installing CMake
- Building CMake from source
- Building your first project
- A minimal CMakeLists.txt file
- Understanding the CMake build process
- Source folders and build folders
- Single-configuration and multi-configuration generators
- Writing CMake files
- The CMake language
- a 10,000-foot overview
- Different toolchains and build types
- Build types
- Maintaining good build configurations with presets
- Summary
- Further reading
- Questions
- Answers
- Chapter 2: Accessing CMake in the Best Ways
- Technical requirements
- Using CMake via a command-line interface
- Learning the basics of the CMake CLI
- Advanced configuration using CMake-GUI and ccmake
- Learning how to use ccmake (CMake curses GUI)
- Using CMake via cmake-gui
- Tweaking environment variables
- Evaluating regular expressions with CMake
- Using CMake in Visual Studio, VSCode, and Qt Creator
- Visual Studio
- Visual Studio Code
- Qt Creator
- Summary
- Questions
- Answers
- Further reading
- Chapter 3: Creating a CMake Project
- Technical requirements
- Setting up a project
- Working with nested projects
- Creating a "hello world" executable
- Creating a simple library
- Library aliases
- Naming libraries
- Symbol visibility in shared libraries
- Interface or header-only libraries
- Bringing it together
- using your libraries
- Setting compiler and linker options
- Summary
- Questions
- Answers
- Part 2
- Practical CMake
- Getting Your Hands Dirty with CMake
- Chapter 4: Packaging, Deploying, and Installing a CMake Project
- Technical requirements
- Making CMake targets installable
- The install() command
- Supplying configuration information for others using your project
- Entering the CMake package world
- Config-file packages
- Creating an installable package with CPack
- Creating standalone installers for Windows
- Summary
- Questions
- Answers
- Chapter 5: Integrating Third-Party Libraries and Dependency Management
- Technical requirements
- Finding files, programs, and paths with CMake
- Finding files and paths
- Finding programs
- Finding libraries
- Using third-party libraries in your CMake project
- Writing your own find module
- Using package managers with CMake
- Using Conan to get dependencies
- Using vcpkg for dependency management
- Getting the dependencies as source code
- Downloading dependencies as the source using pure CMake
- Summary
- Questions
- Answers
- Chapter 6: Automatically Generating Documentation
- Technical requirements
- Generating documentation from your code
- Understanding what Doxygen is
- Using Doxygen with CMake
- Embedding custom UML diagrams into documentation