-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Minimal CMake
By :

Now that we are up and running with CMake, one of the most useful features to be aware of is FetchContent
. FetchContent
is a CMake feature that allows you to bring external libraries (also called dependencies) into your project. It only takes a few lines of code and is quick and convenient to use. It does rely on the dependency also using CMake, but the good news is that a considerable proportion of open source software written in C and C++ uses CMake to build itself. Even if the dependency doesn’t use CMake, adding CMake support is often quite easy and makes consuming the library a lot simpler.
We’ll see how to use FetchContent
in the context of our project to introduce some new useful functionality to our app. We’ll also cover some subtleties to be aware of while using it. By the end of the chapter, you’ll be able to use external libraries with confidence.
In this chapter, we’re going to cover...