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

Function NormalizeInclude

Source/cmIncludeDirectoryCommand.cxx:115–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static void NormalizeInclude(cmMakefile& mf, std::string& inc)
116{
117 std::string::size_type b = inc.find_first_not_of(" \r");
118 std::string::size_type e = inc.find_last_not_of(" \r");
119 if ((b != std::string::npos) && (e != std::string::npos)) {
120 inc.assign(inc, b, 1 + e - b); // copy the remaining substring
121 } else {
122 inc.clear();
123 return;
124 }
125
126 if (!cmIsOff(inc)) {
127 cmSystemTools::ConvertToUnixSlashes(inc);
128 if (!cmSystemTools::FileIsFullPath(inc) &&
129 !cmGeneratorExpression::StartsWithGeneratorExpression(inc)) {
130 inc = cmStrCat(mf.GetCurrentSourceDirectory(), '/', inc);
131 }
132 }
133}

Callers 1

GetIncludesFunction · 0.85

Calls 6

cmIsOffFunction · 0.85
find_first_not_ofMethod · 0.80
find_last_not_ofMethod · 0.80
assignMethod · 0.80
cmStrCatFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…