# Using FetchContent to download specific folders in a repo

**URL:** https://discourse.cmake.org/t/using-fetchcontent-to-download-specific-folders-in-a-repo/14474
**Category:** Usage
**Created:** [July 30, 2025, 8:46pm UTC](https://discourse.cmake.org/t/using-fetchcontent-to-download-specific-folders-in-a-repo/14474 "2025-07-30T20:46:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jasonaylward](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jasonaylward/32/2219_2.png) [@jasonaylward](https://discourse.cmake.org/u/jasonaylward)
#### Post date: [July 30, 2025, 8:46pm UTC](https://discourse.cmake.org/t/using-fetchcontent-to-download-specific-folders-in-a-repo/14474/1 "2025-07-30T20:46:15Z")

</div>

Is it possible to use FetchContent to pull down specific folders in a repo OR exclude specific folders?  
I have a dependency in one of my projects that has a folder of images and other assets that I don’t need. It would be great to either exclude it or specify the exact folders that I need before building.

Thanks.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 30, 2025, 9:19pm UTC](https://discourse.cmake.org/t/using-fetchcontent-to-download-specific-folders-in-a-repo/14474/2 "2025-07-30T21:19:51Z")

</div>

If you can come up with a URL that captures what you want to download, then FetchContent can do it. FetchContent isn’t anything special here, it’s essentially just a wrapper around either `file(DOWNLOAD)`, or a collection of source control commands. The URL-based downloads will typically be more efficient for dependencies that change rarely, and are probably your only viable path here, assuming you can actually come up with a suitable URL.

---

<div class="post-metadata">

### Author: ![jasonaylward](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jasonaylward/32/2219_2.png) [@jasonaylward](https://discourse.cmake.org/u/jasonaylward)
#### Post date: [July 30, 2025, 9:42pm UTC](https://discourse.cmake.org/t/using-fetchcontent-to-download-specific-folders-in-a-repo/14474/3 "2025-07-30T21:42:51Z")

</div>

That works for me.  
I had a vague memory have being able to specify folders in FetchContent\_MakeAvailable but I couldn’t find anything in the documentation that seemed right. Maybe this is actually what I settled on before also. Thanks.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 30, 2025, 10:23pm UTC](https://discourse.cmake.org/t/using-fetchcontent-to-download-specific-folders-in-a-repo/14474/4 "2025-07-30T22:23:05Z")

</div>

> [@jasonaylward](#):
>
> I had a vague memory have being able to specify folders in FetchContent\_MakeAvailable

`FetchContent_MakeAvailable()` has never supported anything other than a list of dependencies to make available.
