Can this function be used inside any CMakeLists file? That was my first intuition, but (if I'm not mistaken) doing so has overwritten my CMakeLists. I suppose it only meant to be used inside a .gitexternals file which will be overwritten. If so, this should be stated more clearly!