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

Shallow submodules #573

Open
artiomn opened this issue Jul 16, 2024 · 1 comment
Open

Shallow submodules #573

artiomn opened this issue Jul 16, 2024 · 1 comment

Comments

@artiomn
Copy link

artiomn commented Jul 16, 2024

Some projects that project depends on may have a large number of submodules.
Can CPM clone these projects without history or with a history depth limitation for all submodules?

I.e.: https://stackoverflow.com/a/17692710/7883447

Is it possible?

This will probably have a good effect on increasing build speed.

@Avus-c
Copy link
Contributor

Avus-c commented Jul 22, 2024

CPM itself does not handle the download/clone operation. This task is performed by CMake's FetchContent module.

You can add GIT_SHALLOW TRUE to the CPMAddPackage call, although I am unsure if this setting is forwarded when cloning submodules. Other than that, there isn't much we can do.

For more options related to git, you can take a look here.
I only took a quick look, but haven't found anything that could help.

On a sidenote: Any argument that isn't part of the CPMAddPackage signature is forwarded to FetchContent_*.
(We should probably document this somewhere if it isn't : ) )

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