Getting the dependencies as source code
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 pretty fast, it quickly becomes tedious and hard to maintain. So, this should be automated as soon as possible.
Note
The practice of downloading and integrating a copy of a 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 either a package manager or by installing the third-party software in a location on your system.
Downloading dependencies as the source using pure CMake
At the base of getting external content is the CMake ExternalProject
module and the more sophisticated FetchContent
module, which is...