# FetchContent of an install tarball

**URL:** https://discourse.cmake.org/t/fetchcontent-of-an-install-tarball/10479
**Category:** Usage
**Created:** [March 26, 2024, 2:54am UTC](https://discourse.cmake.org/t/fetchcontent-of-an-install-tarball/10479 "2024-03-26T02:54:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dabrahams](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dabrahams/32/4265_2.png) [@dabrahams](https://discourse.cmake.org/u/dabrahams)
#### Post date: [March 26, 2024, 2:54am UTC](https://discourse.cmake.org/t/fetchcontent-of-an-install-tarball/10479/1 "2024-03-26T02:54:51Z")

</div>

I have a tarball of a pre-compiled LLVM installation that I’d like to download with `FetchContent` and integrate into my project. I may have missed it in the docs if this use case is directly supported. I want to use `FetchContent` so users or dependent projects can supply LLVM differently if they so choose. Is there an easy way to do this? (The `LLVMConfig.cmake` is located in `lib/cmake/llvm/` relative to the top of the unpacked tarball).

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 11, 2024, 3:29am UTC](https://discourse.cmake.org/t/fetchcontent-of-an-install-tarball/10479/2 "2024-04-11T03:29:04Z")

</div>

Maybe `FetchContent` is overly complex here? Why not `file(DOWNLOAD)`, verify it with a hash, and extract it? If users want to supply their own, they can set the directory that guards the actions to some pre-existing LLVM prefix (e.g., a simple `if (EXISTS)` check in your code.

Cc: @craig.scott

---

<div class="post-metadata">

### Author: ![dabrahams](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dabrahams/32/4265_2.png) [@dabrahams](https://discourse.cmake.org/u/dabrahams)
#### Post date: [April 15, 2024, 7:11pm UTC](https://discourse.cmake.org/t/fetchcontent-of-an-install-tarball/10479/3 "2024-04-15T19:11:39Z")

</div>

> Maybe `FetchContent` is overly complex here? Why not `file(DOWNLOAD)` , verify it with a hash, and extract it?

Sounds a bit like you’re saying, “why not take charge of the whole process yoursef?” I don’t think `FetchContent` creates any problems for me that I’d be able to avoid by doing that, but I don’t know yet because I haven’t tried. The larger gist of the question is heading in the opposite direction: “this seems like a fairly run-of-the-mill need I’ve got; is there a way to avoid taking responsibility for _all_ the steps myself?” For example, maybe there’s a download + extract + discard-the-original-file (or stream it into extraction) function? I don’t actually need to use `FetchContent` of course.
