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

Method ProcessContentArgs

Source/cmTargetPropCommandBase.cxx:121–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121bool cmTargetPropCommandBase::ProcessContentArgs(
122 std::vector<std::string> const& args, unsigned int& argIndex, bool prepend,
123 bool system)
124{
125 std::string const& scope = args[argIndex];
126
127 if (scope != "PUBLIC" && scope != "PRIVATE" && scope != "INTERFACE") {
128 this->SetError("called with invalid arguments");
129 return false;
130 }
131
132 ++argIndex;
133
134 std::vector<std::string> content;
135
136 for (unsigned int i = argIndex; i < args.size(); ++i, ++argIndex) {
137 if (args[i] == "PUBLIC" || args[i] == "PRIVATE" ||
138 args[i] == "INTERFACE") {
139 break;
140 }
141 content.push_back(args[i]);
142 }
143 if (!content.empty()) {
144 if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
145 scope != "INTERFACE" && this->Property != "SOURCES") {
146 this->SetError("may only set INTERFACE properties on INTERFACE targets");
147 return false;
148 }
149 if (this->Target->IsImported() && scope != "INTERFACE") {
150 this->SetError("may only set INTERFACE properties on IMPORTED targets");
151 return false;
152 }
153 if (this->Target->GetType() == cmStateEnums::UTILITY &&
154 scope != "PRIVATE") {
155 this->SetError("may only set PRIVATE properties on custom targets");
156 return false;
157 }
158 }
159 return this->PopulateTargetProperties(scope, content, prepend, system);
160}
161
162bool cmTargetPropCommandBase::PopulateTargetProperties(
163 std::string const& scope, std::vector<std::string> const& content,

Callers 1

HandleArgumentsMethod · 0.95

Calls 7

SetErrorMethod · 0.95
push_backMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
GetTypeMethod · 0.45
IsImportedMethod · 0.45

Tested by

no test coverage detected