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

Function relativeIfUnder

Source/cmLocalGenerator.cxx:4338–4349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4336
4337namespace {
4338std::string relativeIfUnder(std::string const& top, std::string const& cur,
4339 std::string const& path)
4340{
4341 // Use a path relative to 'cur' if it can be expressed without
4342 // a `../` sequence that leaves 'top'.
4343 if (cmSystemTools::IsSubDirectory(path, cur) ||
4344 (cmSystemTools::IsSubDirectory(cur, top) &&
4345 cmSystemTools::IsSubDirectory(path, top))) {
4346 return cmSystemTools::ForceToRelativePath(cur, path);
4347 }
4348 return path;
4349}
4350}
4351
4352std::string cmLocalGenerator::GetRelativeSourceFileName(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…