FetchContent of an install tarball

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).

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

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.