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, we will also learn how to visualize the dependencies between the different targets.
In this chapter, we will cover the following topics:
- Setting up a project
- Creating a “hello world” executable
- Creating a simple...