CPM and Submodules Git #188
Replies: 1 comment
-
As CPM.cmake forwards its arguments to CMake's
Specific git submodules that should also be updated. If this option is not provided, all git submodules will be updated. When
Specify whether git submodules (if any) should update recursively by passing the --recursive flag to git submodule update. If not specified, the default is on. So it does appear that by default CPM.cmake should indeed initialise a dependencies submodules. As for disabling the recursive clone, it seems that setting |
Beta Was this translation helpful? Give feedback.
-
Very good morning, the following is a couple of questions that have arisen from a structuring that my project has suffered.
How does the configuration of a project work when it has several or a single git submodule/s? Does CPM download these submodules? If the above question is yes, is there a way to prevent CPM from downloading these submodules?
To give a little more context, I happen to have divided my project into submodules, but these submodules do not contain anything that can stop the compilation process and use of my project (library), because they do not contain code and only contains the documentation of the project, I have done so (using submodules), because I am currently using CPM to download and configure that dependency automatically, see the following projects.
The issue is that, currently my project contains a website (where the documentation resides) and a couple of directories containing images (fonts), however, external projects (other people's projects) using my library will probably not need all those fonts at first, Another reason for using submodules is the possibility of reducing the time it takes for CPM (Fetch_Content) to download the project, hence the question of how to avoid (in case it really happens) that CPM downloads these submodules.
But there is also another reason that leads me to separate the project into submodules, such as the convenience of separating issues and Pull Request for each section, as well as the opinion I have about how my project should be used, that is, as a downloadable dependency from the Internet and not installable on the system (although no one prevents you from doing so).
Beta Was this translation helpful? Give feedback.
All reactions