1 option
CMake Best Practices : Upgrade Your C++ Builds with CMake for Maximum Efficiency and Scalability.
- Format:
- Book
- Author/Creator:
- Berner, Dominik.
- Language:
- English
- Subjects (All):
- CMake (Computer program).
- Computer software--Development.
- Computer software.
- C++ (Computer program language).
- Physical Description:
- 1 online resource (356 p.)
- Edition:
- 2nd ed.
- Place of Publication:
- Birmingham : Packt Publishing, Limited, 2024.
- Summary:
- 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 configurations and embrace modern package management with Conan 2.0. Covering advanced methods to integrate third-party libraries and optimize cross-platform builds, this updated edition introduces new tools and techniques to enhance software quality, including testing frameworks, fuzzers, and automated documentation generation. Through hands-on examples, you’ll become proficient in structuring complex projects, ensuring that your builds run smoothly across different environments. Whether you’re integrating tools for continuous integration or packaging software for distribution, this book equips you with the skills needed to excel in modern software development. By the end of the book, you’ll have mastered setting up and maintaining robust software projects using CMake to streamline your development workflow and produce high-quality software.
- Contents:
- 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
- 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
- Chapter 3: Creating a CMake Project
- 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
- 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
- Chapter 5: Integrating Third-Party Libraries and Dependency Management
- 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
- Chapter 6: Automatically Generating Documentation
- Generating documentation from your code
- Understanding what Doxygen is
- Using Doxygen with CMake
- Embedding custom UML diagrams into documentation
- Notes:
- Description based upon print version of record.
- Packaging and distributing documentation with CPack
- OCLC-licensed vendor bibliographic record.
- ISBN:
- 9781835880647
- 1835880649
- OCLC:
- 1453194522
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.