FetchContentDeclareNAME
FetchContentDeclare is a command provided by the CMake FetchContent module that declares an external content source to be downloaded and used in a build. It is part of a family of facilities designed to integrate third‑party libraries without requiring system-wide installation. The typical workflow is to declare a dependency by name and a set of retrieval options, such as a URL or a Git repository, along with a version specifier or tag.
The declared content can then be fetched and integrated into the build using subsequent commands like FetchContent_MakeAvailable
Usage patterns typically involve including the module, declaring the content with options such as GIT_REPOSITORY, GIT_TAG,
FetchContent is often contrasted with ExternalProject_Add; FetchContent tends to be simpler for pulling in libraries that