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

Function HandleRPathCheckCommand

Source/cmFileCommand.cxx:1187–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185}
1186
1187bool HandleRPathCheckCommand(std::vector<std::string> const& args,
1188 cmExecutionStatus& status)
1189{
1190 // Evaluate arguments.
1191 std::string file;
1192 cm::optional<std::string> rpath;
1193 cmArgumentParser<void> parser;
1194 std::vector<std::string> unknownArgs;
1195 parser.Bind("FILE"_s, file).Bind("RPATH"_s, rpath);
1196 ArgumentParser::ParseResult parseResult =
1197 parser.Parse(cmMakeRange(args).advance(1), &unknownArgs);
1198 if (!unknownArgs.empty()) {
1199 status.SetError(
1200 cmStrCat("RPATH_CHECK given unknown argument ", unknownArgs.front()));
1201 return false;
1202 }
1203 if (parseResult.MaybeReportError(status.GetMakefile())) {
1204 return true;
1205 }
1206 if (file.empty()) {
1207 status.SetError("RPATH_CHECK not given FILE option.");
1208 return false;
1209 }
1210 if (!rpath) {
1211 status.SetError("RPATH_CHECK not given RPATH option.");
1212 return false;
1213 }
1214
1215 // If the file exists but does not have the desired RPath then
1216 // delete it. This is used during installation to re-install a file
1217 // if its RPath will change.
1218 if (cmSystemTools::FileExists(file, true) &&
1219 !cmSystemTools::CheckRPath(file, *rpath)) {
1220 cmSystemTools::RemoveFile(file);
1221 }
1222
1223 return true;
1224}
1225
1226bool HandleReadElfCommand(std::vector<std::string> const& args,
1227 cmExecutionStatus& status)

Callers

nothing calls this directly

Calls 11

cmMakeRangeFunction · 0.85
MaybeReportErrorMethod · 0.80
cmStrCatFunction · 0.70
FileExistsFunction · 0.50
BindMethod · 0.45
ParseMethod · 0.45
advanceMethod · 0.45
emptyMethod · 0.45
SetErrorMethod · 0.45
frontMethod · 0.45
GetMakefileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…