diff options
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestGIT.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmCTestUpdateCommand.cxx | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index da086be..9ee18e6 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -285,9 +285,26 @@ bool cmCTestGIT::UpdateImpl() } } - char const* git_submodule[] = {git, "submodule", "update", recursive, 0}; OutputLogger submodule_out(this->Log, "submodule-out> "); OutputLogger submodule_err(this->Log, "submodule-err> "); + + bool ret; + + std::string init_submodules = + this->CTest->GetCTestConfiguration("GITInitSubmodules"); + if (cmSystemTools::IsOn(init_submodules.c_str())) + { + char const* git_submodule_init[] = {git, "submodule", "init", 0}; + ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err, + top_dir.c_str()); + + if (!ret) + { + return false; + } + } + + char const* git_submodule[] = {git, "submodule", "update", recursive, 0}; return this->RunChild(git_submodule, &submodule_out, &submodule_err, top_dir.c_str()); } diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index dfda9f1..1bf60fc 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -55,6 +55,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler() this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS", this->Quiet); this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, + "GITInitSubmodules", "CTEST_GIT_INIT_SUBMODULES", this->Quiet); + this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM", this->Quiet); this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "UpdateVersionOnly", "CTEST_UPDATE_VERSION_ONLY", this->Quiet); |