I need to write a script to clone Boost library, but the repository is unfortunately really big and I need to use just some submodules afterwards. I'd like to store them in one string variable like this
set(MODULES tools/build libs/system)
and then pass the variable in to one command like this
git clone --recurse-submodules=${MODULES} https://github.com/boostorg/boost.git
The problem is, that after passing multiple arguments into --recurse-submodules
, all of them get ignored.
I had a look at How to only update specific git submodules?, but the answers cover only cloning of one submodules or repeating --recurse-submodules
multiple times, which I don't like to, as I want to make the script prepared for arbitrary number of submodules.
Is there any way how to achieve that with Git and CMake? I'd like to stay there for my code to remain multiplatform.
I know, how to do that using Bash, but I have no idea, if something similar is possible in CMake.