Skip to content

Do not download unused submodules for CPM package #964

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

Merged
merged 1 commit into from
Jul 4, 2025

Conversation

alxvth
Copy link
Contributor

@alxvth alxvth commented Jul 4, 2025

CMake let's you define a list of submodules that should be downloaded when fetching remote repos, see ExternalProject docs (same mechanism is used for the FetchContent commands, see here.

For valijson we do not want any submodules to be downloaded, but CPM does not currently parse the option GIT_SUBMODULES "" correctly. There seems to be issues with handling empty strings.

However, there is a workaround: specify an existing subdir from the repo to not download any submodules.

This small change will speed up the CMake config a bit and reduce the size of the build folder, as we skip downloading seven remote projects.

@alxvth alxvth merged commit 9b5dc4d into master Jul 4, 2025
10 checks passed
@alxvth alxvth deleted the feature/CpmDontDownloadAllSubmodules branch July 4, 2025 08:46
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

Successfully merging this pull request may close these issues.

1 participant