| 443 | } // END: namespace SetPropertyCommand |
| 444 | |
| 445 | bool cmSetPropertyCommand(std::vector<std::string> const& args, |
| 446 | cmExecutionStatus& status) |
| 447 | { |
| 448 | if (args.size() < 2) { |
| 449 | status.SetError("called with incorrect number of arguments"); |
| 450 | return false; |
| 451 | } |
| 452 | |
| 453 | // Get the scope on which to set the property. |
| 454 | std::string const& scopeName = args.front(); |
| 455 | cmProperty::ScopeType scope; |
| 456 | if (scopeName == "GLOBAL") { |
| 457 | scope = cmProperty::GLOBAL; |
| 458 | } else if (scopeName == "DIRECTORY") { |
| 459 | scope = cmProperty::DIRECTORY; |
| 460 | } else if (scopeName == "TARGET") { |
| 461 | scope = cmProperty::TARGET; |
| 462 | } else if (scopeName == "FILE_SET") { |
| 463 | scope = cmProperty::FILE_SET; |
| 464 | } else if (scopeName == "SOURCE") { |
| 465 | scope = cmProperty::SOURCE_FILE; |
| 466 | } else if (scopeName == "TEST") { |
| 467 | scope = cmProperty::TEST; |
| 468 | } else if (scopeName == "CACHE") { |
| 469 | scope = cmProperty::CACHE; |
| 470 | } else if (scopeName == "INSTALL") { |
| 471 | scope = cmProperty::INSTALL; |
| 472 | } else { |
| 473 | status.SetError(cmStrCat("given invalid scope ", scopeName, |
| 474 | ". Valid scopes are GLOBAL, DIRECTORY, TARGET, " |
| 475 | "FILE_SET, SOURCE, TEST, CACHE, INSTALL.")); |
| 476 | return false; |
| 477 | } |
| 478 | |
| 479 | bool appendAsString = false; |
| 480 | bool appendMode = false; |
| 481 | bool remove = true; |
| 482 | std::set<std::string> names; |
| 483 | std::string propertyName; |
| 484 | std::string propertyValue; |
| 485 | |
| 486 | std::string file_set_target_name; |
| 487 | bool file_set_target_option_enabled = false; |
| 488 | |
| 489 | std::vector<std::string> source_file_directories; |
| 490 | std::vector<std::string> source_file_target_directories; |
| 491 | bool source_file_directory_option_enabled = false; |
| 492 | bool source_file_target_option_enabled = false; |
| 493 | |
| 494 | std::string test_directory; |
| 495 | bool test_directory_option_enabled = false; |
| 496 | |
| 497 | // Parse the rest of the arguments up to the values. |
| 498 | enum Doing |
| 499 | { |
| 500 | DoingNone, |
| 501 | DoingNames, |
| 502 | DoingProperty, |
nothing calls this directly
no test coverage detected
searching dependent graphs…