In my ExternalProject
builds, I have them directed to store to ${CMAKE_BINARY_DIR}/downloads
. On my machine, I symlink this to a common store between a variety of superbuilds. There’s been discussion to have a user-wide cache for ExternalProject
sources (which I assume will help FetchContent
as well), but it’s not a simple thing (especially for VCS sources).
See this discussion and links from it: ExternalProject_Add cache for git repositories