# Caching FetchContent source in a different directory

**URL:** https://discourse.cmake.org/t/caching-fetchcontent-source-in-a-different-directory/8326
**Category:** Code
**Created:** [June 13, 2023, 6:20pm UTC](https://discourse.cmake.org/t/caching-fetchcontent-source-in-a-different-directory/8326 "2023-06-13T18:20:54Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![codeling](https://discourse.cmake.org/user_avatar/discourse.cmake.org/codeling/32/1700_2.png) [@codeling](https://discourse.cmake.org/u/codeling)
#### Post date: [June 19, 2023, 10:54am UTC](https://discourse.cmake.org/t/caching-fetchcontent-source-in-a-different-directory/8326/2 "2023-06-19T10:54:58Z")

</div>

A while back there was a related discussion on [caching git repositories for ExternalProject\_Add](https://discourse.cmake.org/t/externalproject-add-cache-for-git-repositories/4218).

The [linked proposal](https://gitlab.kitware.com/cmake/cmake/-/issues/22688) mentions that git has a solution for this (url..insteadOf).

Hope this helps.

---

_[View the full topic](https://discourse.cmake.org/t/caching-fetchcontent-source-in-a-different-directory/8326)._
