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

Method GetDefinition

Source/cmMakefile.cxx:2390–2417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2388}
2389
2390cmValue cmMakefile::GetDefinition(std::string const& name) const
2391{
2392 cmValue def = this->StateSnapshot.GetDefinition(name);
2393 if (!def) {
2394 def = this->GetState()->GetInitializedCacheValue(name);
2395 }
2396#ifndef CMAKE_BOOTSTRAP
2397 cmVariableWatch* vv = this->GetVariableWatch();
2398 if (vv) {
2399 bool const watch_function_executed =
2400 vv->VariableAccessed(name,
2401 def ? cmVariableWatch::VARIABLE_READ_ACCESS
2402 : cmVariableWatch::UNKNOWN_VARIABLE_READ_ACCESS,
2403 def.GetCStr(), this);
2404
2405 if (watch_function_executed) {
2406 // A callback was executed and may have caused re-allocation of the
2407 // variable storage. Look it up again for now.
2408 // FIXME: Refactor variable storage to avoid this problem.
2409 def = this->StateSnapshot.GetDefinition(name);
2410 if (!def) {
2411 def = this->GetState()->GetInitializedCacheValue(name);
2412 }
2413 }
2414 }
2415#endif
2416 return def;
2417}
2418
2419std::string const& cmMakefile::GetSafeDefinition(std::string const& name) const
2420{

Callers 15

GenerateMethod · 0.95
ConfigureMethod · 0.95
IsOnMethod · 0.95
IsSetMethod · 0.95
PlatformIs32BitMethod · 0.95
PlatformIs64BitMethod · 0.95
PlatformIsx32Method · 0.95
GetSONameFlagMethod · 0.95

Calls 5

GetStateMethod · 0.95
GetVariableWatchMethod · 0.95
VariableAccessedMethod · 0.80
GetCStrMethod · 0.80

Tested by 14

ProcessStepsMethod · 0.36
PopulateCustomVectorMethod · 0.36
PopulateCustomIntegerMethod · 0.36
InitializeHandlerMethod · 0.36
PopulateCustomVectorsMethod · 0.36
GetListOfTestsMethod · 0.36
InitializeHandlerMethod · 0.36
InitialPassMethod · 0.36
InitialCheckoutMethod · 0.36
InitializeHandlerMethod · 0.36
ExecuteHandlerCommandMethod · 0.36