cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] Use git worktrees instead of individual clones in cache

touraill-adobe opened this issue · comments

When using CPM_SOURCE_CACHE, each dependency is cloned in its own folder even if they are just different commits of the same repo. It seems to me that using git worktree would greatly optimize the download time and storage usage, by cloning a remote repo only once.

The behavior I would expect would be to have one folder in the cache per repo url, that contains a bare repo, then the usual hashed folders with worktrees created from this repo.

What do you think?

That's a pretty cool git feature I wasn't aware of! I agree it would make a lot of sense for CPM to use this feature.