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

Function cmCMakeLanguageCommandEVAL

Source/cmCMakeLanguageCommand.cxx:198–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198bool cmCMakeLanguageCommandEVAL(std::vector<cmListFileArgument> const& args,
199 cmExecutionStatus& status)
200{
201 cmMakefile& makefile = status.GetMakefile();
202 cmListFileContext context = makefile.GetBacktrace().Top();
203 std::vector<std::string> expandedArgs;
204 makefile.ExpandArguments(args, expandedArgs);
205
206 if (expandedArgs.size() < 2) {
207 return FatalError(status, "called with incorrect number of arguments");
208 }
209
210 if (expandedArgs[1] != "CODE") {
211 auto code_iter =
212 std::find(expandedArgs.begin() + 2, expandedArgs.end(), "CODE");
213 if (code_iter == expandedArgs.end()) {
214 return FatalError(status, "called without CODE argument");
215 }
216 return FatalError(
217 status,
218 "called with unsupported arguments between EVAL and CODE arguments");
219 }
220
221 std::string const code =
222 cmJoin(cmMakeRange(expandedArgs.begin() + 2, expandedArgs.end()), " ");
223 return makefile.ReadListFileAsString(
224 code, cmStrCat(context.FilePath, ':', context.Line, ":EVAL"));
225}
226
227bool cmCMakeLanguageCommandSET_DEPENDENCY_PROVIDER(
228 std::vector<std::string> const& args, cmExecutionStatus& status)

Callers 1

cmCMakeLanguageCommandFunction · 0.85

Calls 12

FatalErrorFunction · 0.85
cmMakeRangeFunction · 0.85
ExpandArgumentsMethod · 0.80
ReadListFileAsStringMethod · 0.80
cmJoinFunction · 0.70
cmStrCatFunction · 0.70
findFunction · 0.50
GetMakefileMethod · 0.45
GetBacktraceMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…