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

Function HandleSourceMode

Source/cmSetPropertyCommand.cxx:804–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804bool 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
837bool HandleSource(cmSourceFile* sf, std::string const& propertyName,
838 std::string const& propertyValue, bool appendAsString,

Callers 1

cmSetPropertyCommandFunction · 0.70

Calls 7

HandleSourceFunction · 0.85
GetOrCreateSourceMethod · 0.80
cmStrCatFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…