Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying CMake Best Practices
  • Table Of Contents Toc
  • Feedback & Rating feedback
CMake Best Practices

CMake Best Practices - Second Edition

By : Berner, Mustafa Kemal Gilor
close
close
CMake Best Practices

CMake Best Practices

By: Berner, Mustafa Kemal Gilor

Overview of this book

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.
Table of Contents (22 chapters)
close
close
Lock Free Chapter
1
Part 1 – The Basics
5
Part 2 – Practical CMake – Getting Your Hands Dirty with CMake
14
Part 3 – Mastering the Details

Profiling a CMake build

When CMake projects get big, configuring them might take quite a long time, especially if there is external content loaded or if there are lots of checks done for toolchain features. A first step to optimize this is to check what part of the configuration process takes up how much time. Since version 3.18, CMake has included command-line options to produce nice profiling graphs to investigate where time is spent during configuration. By adding the --profiling-output and --profiling-format profiling flags, CMake will create profiling output. At the time of writing this book, only the Google trace format for output format is supported. Despite this, the format and the file need to be specified to create profiling information. A call to CMake to create a profiling graph could look like this:

cmake -S <sourceDir> -B <buildDir> --profiling-output
./profiling.json --profiling-format=google-trace

This will write the profiling output to the profiling...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
CMake Best Practices
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon