-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
CMake Best Practices - Second Edition
By :
There are several ways to get dependencies as sources into your project. A relatively straightforward but dangerous way is to manually download or clone them into a subfolder inside your project and then add this folder with add_subdirectory. While this works and is fast, it quickly becomes tedious and hard to maintain. So, this should be automated as soon as possible.
The practice of downloading and integrating a copy of third-party software directly into a product is called vendoring. While it has the advantage that it often makes building software easy, it creates issues with packaging libraries. Vendoring is avoided by either using a package manager or by installing third-party software into a location on your system.
At the base of getting external content is the CMake ExternalProject module and the more sophisticated FetchContent module, which is built on ExternalProject...