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

Using CMake for platform-independent commands

One of the keystones for the success of CMake is that it allows you to build the same software on a multitude of platforms. Conversely, this means that CMakeLists.txt must be written in a way that does not assume a certain platform or compiler must be used. This can be challenging, especially when you’re working with custom tasks. A big help here is that the cmake command-line utility supports the -E flag, which can be used to perform common tasks such as file operations and creating hashes. Most of the cmake -E commands are for file-related operations such as creating, copying, renaming, and deleting files, as well as creating directories. On systems that support filesystem links, CMake can also create symbolic links or hard links between files. Since CMake version 3.21, most of them are also available by using the file() command, but not all of them. Notably, creating hashes from files can be done in a platform-independent way...

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