MCPcopy Create free account
hub / github.com/Kitware/CMake / ClearMatches

Method ClearMatches

Source/cmMakefile.cxx:4015–4032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4013static std::string const nMatchesVariable = "CMAKE_MATCH_COUNT";
4014
4015void cmMakefile::ClearMatches()
4016{
4017 cmValue nMatchesStr = this->GetDefinition(nMatchesVariable);
4018 if (!nMatchesStr) {
4019 return;
4020 }
4021 int nMatches = atoi(nMatchesStr->c_str());
4022 for (int i = 0; i <= nMatches; i++) {
4023 std::string const& var = matchVariables[i];
4024 std::string const& s = this->GetSafeDefinition(var);
4025 if (!s.empty()) {
4026 this->AddDefinition(var, "");
4027 this->MarkVariableAsUsed(var);
4028 }
4029 }
4030 this->AddDefinition(nMatchesVariable, "0");
4031 this->MarkVariableAsUsed(nMatchesVariable);
4032}
4033
4034void cmMakefile::StoreMatches(cmsys::RegularExpression& re)
4035{

Callers 5

HandleLevel2Method · 0.80
ReplaceMethod · 0.80
cmCMakeString.cxxFile · 0.80
MatchMethod · 0.80
HandleStringsCommandFunction · 0.80

Calls 5

GetDefinitionMethod · 0.95
AddDefinitionMethod · 0.95
MarkVariableAsUsedMethod · 0.95
c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected