CPM.cmake icon indicating copy to clipboard operation
CPM.cmake copied to clipboard

[Feature Request] Use the git commit hash or tag as folder name.

Open Febbe opened this issue 3 years ago • 1 comments

If a specific hash is provided with: #<hash> the foldername should be <hash>. If a tag or version is provided, I would like to have the ability, to also have

  • <tag> for #<tag> and
  • v<version> for @<version>

The current used uid just hides this information without adding any benefit.

Febbe avatar Nov 23 '22 18:11 Febbe

Currently the name of the cache directories comes from the hash of all arguments that get forwarded to FetchContent. This is because we want to differentiate between different sources, patch commands, clone depths etc. which would otherwise create conflicts and unexpected issues.

One solution would be to use nested directories, similar to the CPM_USE_NAMED_CACHE_DIRECTORIES option, perhaps it's possible to add similar behaviour there.

TheLartians avatar Nov 29 '22 16:11 TheLartians