| 213 | } |
| 214 | |
| 215 | bool HandleSetCommand(std::vector<std::string> const& args, |
| 216 | cmExecutionStatus& status) |
| 217 | { |
| 218 | if (args.size() < 3 || args.size() > 4) { |
| 219 | status.SetError("SET must be called with two or three arguments."); |
| 220 | return false; |
| 221 | } |
| 222 | |
| 223 | if (args[1].empty()) { |
| 224 | status.SetError("Invalid name for path variable."); |
| 225 | return false; |
| 226 | } |
| 227 | |
| 228 | static NormalizeParser const parser; |
| 229 | |
| 230 | auto const arguments = parser.Parse(args); |
| 231 | |
| 232 | if (parser.GetInputs().size() != 1) { |
| 233 | status.SetError("SET called with unexpected arguments."); |
| 234 | return false; |
| 235 | } |
| 236 | |
| 237 | auto path = |
| 238 | cmCMakePath(parser.GetInputs().front(), cmCMakePath::native_format); |
| 239 | |
| 240 | if (arguments.Normalize) { |
| 241 | path = path.Normal(); |
| 242 | } |
| 243 | |
| 244 | status.GetMakefile().AddDefinition(args[1], path.GenericString()); |
| 245 | |
| 246 | return true; |
| 247 | } |
| 248 | |
| 249 | bool HandleAppendCommand(std::vector<std::string> const& args, |
| 250 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…