3

Creating a CMake Project

By now, you should be familiar with how to use CMake and its basic concepts, such as the two-stage build. So far, we have only looked at how CMake is used with code that already exists, but the more interesting part is when it comes to building an application using CMake. In this chapter, you will learn how to build executables and libraries and how to use them together. We will have an in-depth look at creating different kinds of libraries and we will present some good practices about how to structure CMake projects. As libraries often come with a variety of compiler settings, we will learn how we can set them and pass them on to dependent libraries if necessary. Since dependencies in projects can get quite complicated, ...

Get CMake Best Practices - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.