Git Submodule Method

    The relative path to the repo is important; it allows you to keep the same access method (ssh or https) as the parent repository. This works very well in most ways. When you are inside the submodule, you can treat it just like a normal repo, and when you are in the parent repository, you can “add” to change the current commit pointer.

    The first line checks for Git using CMake’s built in . Then, if you are in a git checkout of your source, add an option (defaulting to ON) that allows developers to turn off the feature if they need to. We then run the command to get all repositories, and fail if that command fails, with a nice error message. Finally, we verify that the repositories exist before continuing, regardless of the method used to obtain them. You can use OR to list several.

    You can then include projects that provide good CMake support:

    Move this to Git section: