Cmake [upd] Download_dir May 2026
: If you only want to change the download folder for a specific dependency, you can still pass DOWNLOAD_DIR to FetchContent_Declare . Key Directory Options for External Content
: If multiple builds use the same large archives, pointing them to a common DOWNLOAD_DIR can save significant bandwidth and time. cmake download_dir
To fully control your external dependencies, it's helpful to understand the relationship between these related directory options: Description Default (ExternalProject) The root directory for the external project. DOWNLOAD_DIR Where the raw archive is stored (URL method only). /src SOURCE_DIR Where the project is unpacked or cloned. /src/ BINARY_DIR Where the external project is built. /src/ -build TMP_DIR Where temporary files are stored during the process. /tmp Why Change the Download Directory? : If you only want to change the
: Keeping the build tree clean by moving large .zip or .tar.gz files into a dedicated "downloads" or "cache" folder. DOWNLOAD_DIR Where the raw archive is stored (URL
: When overriding DOWNLOAD_DIR , always use absolute paths (e.g., using ${CMAKE_BINARY_DIR} ) to ensure the location is consistent across different generator environments.