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

Function HandlePathCommand

Source/cmFileCommand.cxx:1661–1680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659}
1660
1661bool HandlePathCommand(std::vector<std::string> const& args,
1662 std::string (*convert)(std::string const&),
1663 cmExecutionStatus& status)
1664{
1665 if (args.size() != 3) {
1666 status.SetError("FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be "
1667 "called with exactly three arguments.");
1668 return false;
1669 }
1670#if defined(_WIN32) && !defined(__CYGWIN__)
1671 char pathSep = ';';
1672#else
1673 char pathSep = ':';
1674#endif
1675 std::vector<std::string> path = cmSystemTools::SplitString(args[1], pathSep);
1676
1677 std::string value = cmList::to_string(cmMakeRange(path).transform(convert));
1678 status.GetMakefile().AddDefinition(args[2], value);
1679 return true;
1680}
1681
1682bool HandleCMakePathCommand(std::vector<std::string> const& args,
1683 cmExecutionStatus& status)

Callers 2

HandleCMakePathCommandFunction · 0.85
HandleNativePathCommandFunction · 0.85

Calls 7

to_stringFunction · 0.85
cmMakeRangeFunction · 0.85
transformMethod · 0.80
sizeMethod · 0.45
SetErrorMethod · 0.45
AddDefinitionMethod · 0.45
GetMakefileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…