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

Function HandleRPathRemoveCommand

Source/cmFileCommand.cxx:1139–1185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137}
1138
1139bool HandleRPathRemoveCommand(std::vector<std::string> const& args,
1140 cmExecutionStatus& status)
1141{
1142 // Evaluate arguments.
1143 std::string file;
1144 cmArgumentParser<void> parser;
1145 std::vector<std::string> unknownArgs;
1146 parser.Bind("FILE"_s, file);
1147 ArgumentParser::ParseResult parseResult =
1148 parser.Parse(cmMakeRange(args).advance(1), &unknownArgs);
1149 if (!unknownArgs.empty()) {
1150 status.SetError(
1151 cmStrCat("RPATH_REMOVE given unknown argument ", unknownArgs.front()));
1152 return false;
1153 }
1154 if (parseResult.MaybeReportError(status.GetMakefile())) {
1155 return true;
1156 }
1157 if (file.empty()) {
1158 status.SetError("RPATH_REMOVE not given FILE option.");
1159 return false;
1160 }
1161 if (!cmSystemTools::FileExists(file, true)) {
1162 status.SetError(
1163 cmStrCat("RPATH_REMOVE given FILE \"", file, "\" that does not exist."));
1164 return false;
1165 }
1166 bool success = true;
1167 cmFileTimes const ft(file);
1168 std::string emsg;
1169 bool removed;
1170 if (!cmSystemTools::RemoveRPath(file, &emsg, &removed)) {
1171 status.SetError(
1172 cmStrCat("RPATH_REMOVE could not remove RPATH from file: \n ", file,
1173 '\n', emsg));
1174 success = false;
1175 }
1176 if (success) {
1177 if (removed) {
1178 std::string message =
1179 cmStrCat("Removed runtime path from \"", file, '"');
1180 status.GetMakefile().DisplayStatus(message, -1);
1181 }
1182 ft.Store(file);
1183 }
1184 return success;
1185}
1186
1187bool HandleRPathCheckCommand(std::vector<std::string> const& args,
1188 cmExecutionStatus& status)

Callers

nothing calls this directly

Calls 13

cmMakeRangeFunction · 0.85
MaybeReportErrorMethod · 0.80
DisplayStatusMethod · 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…