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

Method SetEffectiveProject

Source/cmProjectInfoArguments.cxx:105–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool cmProjectInfoArguments::SetEffectiveProject(cmExecutionStatus& status)
106{
107 if (this->NoProjectDefaults) {
108 // User requested that metadata not be inherited.
109 return true;
110 }
111
112 cmMakefile& mf = status.GetMakefile();
113 if (!this->ProjectName.empty()) {
114 // User specified a project; make sure it exists.
115 if (!mf.GetStateSnapshot().CheckProjectName(this->ProjectName)) {
116 status.SetError(cmStrCat(R"(PROJECT given unknown project name ")"_s,
117 this->ProjectName, R"(".)"_s));
118 return false;
119 }
120 } else {
121 // No project was specified; check if the package name is also a project.
122 std::string project = mf.GetStateSnapshot().GetProjectName();
123 if (this->PackageName == project) {
124 this->ProjectName = std::move(project);
125 }
126 }
127
128 return true;
129}

Callers 1

Calls 8

moveFunction · 0.85
CheckProjectNameMethod · 0.80
cmStrCatFunction · 0.70
GetMakefileMethod · 0.45
emptyMethod · 0.45
GetStateSnapshotMethod · 0.45
SetErrorMethod · 0.45
GetProjectNameMethod · 0.45

Tested by

no test coverage detected