| 802 | } |
| 803 | |
| 804 | bool HandleSourceMode(cmExecutionStatus& status, |
| 805 | std::set<std::string> const& names, |
| 806 | std::string const& propertyName, |
| 807 | std::string const& propertyValue, bool appendAsString, |
| 808 | bool appendMode, bool remove, |
| 809 | std::vector<cmMakefile*> const& directory_makefiles, |
| 810 | bool const source_file_paths_should_be_absolute) |
| 811 | { |
| 812 | std::vector<std::string> files_absolute; |
| 813 | std::vector<std::string> unique_files(names.begin(), names.end()); |
| 814 | SetPropertyCommand::MakeSourceFilePathsAbsoluteIfNeeded( |
| 815 | status, files_absolute, unique_files.begin(), unique_files.end(), |
| 816 | source_file_paths_should_be_absolute); |
| 817 | |
| 818 | for (auto* const mf : directory_makefiles) { |
| 819 | for (std::string const& name : files_absolute) { |
| 820 | // Get the source file. |
| 821 | if (cmSourceFile* sf = mf->GetOrCreateSource(name)) { |
| 822 | if (!HandleSource(sf, propertyName, propertyValue, appendAsString, |
| 823 | appendMode, remove)) { |
| 824 | return false; |
| 825 | } |
| 826 | } else { |
| 827 | status.SetError(cmStrCat( |
| 828 | "given SOURCE name that could not be found or created: ", name)); |
| 829 | return false; |
| 830 | } |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | return true; |
| 835 | } |
| 836 | |
| 837 | bool HandleSource(cmSourceFile* sf, std::string const& propertyName, |
| 838 | std::string const& propertyValue, bool appendAsString, |
no test coverage detected
searching dependent graphs…