Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GIT_SHALLOW still downloads the whole repo #540

Open
Leafmun-certii opened this issue Feb 28, 2024 · 1 comment
Open

GIT_SHALLOW still downloads the whole repo #540

Leafmun-certii opened this issue Feb 28, 2024 · 1 comment

Comments

@Leafmun-certii
Copy link

I am using CPMAddPackage to download a repo at a tag containing a lot less than the main branch. I have specified GIT_SHALLOW, however, this downloads the whole repo before switching to the tag I need.

Is there any way to just download the files specified at the tag? This might be an issue with CMake's Fetch Content but I thought I'd ask here as well just in case anyone has any bright ideas.

Thanks all!

@Longwater1234
Copy link

Longwater1234 commented Mar 1, 2024

@Leafmun-certii Yes this is a common issue. You may want to use GIT_TAG (with hash of the stable commit) instead.

Or even better (for smaller downloads) use github archive URL with your target tag. See example:

CPMAddPackage(
  NAME     spdlog
  URL      https://github.com/gabime/spdlog/archive/refs/tags/v1.12.0.zip
  DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants