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

Method CheckMultipleOutputs

Source/cmLocalUnixMakefileGenerator3.cxx:1649–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1647}
1648
1649void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose)
1650{
1651 cmMakefile* mf = this->Makefile;
1652
1653 // Get the string listing the multiple output pairs.
1654 cmValue pairs_string = mf->GetDefinition("CMAKE_MULTIPLE_OUTPUT_PAIRS");
1655 if (!pairs_string) {
1656 return;
1657 }
1658
1659 // Convert the string to a list and preserve empty entries.
1660 cmList pairs{ *pairs_string, cmList::EmptyElements::Yes };
1661 for (auto i = pairs.begin(); i != pairs.end() && (i + 1) != pairs.end();) {
1662 std::string const& depender = *i++;
1663 std::string const& dependee = *i++;
1664
1665 // If the depender is missing then delete the dependee to make
1666 // sure both will be regenerated.
1667 if (cmSystemTools::FileExists(dependee) &&
1668 !cmSystemTools::FileExists(depender)) {
1669 if (verbose) {
1670 cmSystemTools::Stdout(cmStrCat(
1671 "Deleting primary custom command output \"", dependee,
1672 "\" because another output \"", depender, "\" does not exist.\n"));
1673 }
1674 cmSystemTools::RemoveFile(dependee);
1675 }
1676 }
1677}
1678
1679void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
1680 std::ostream& ruleFileStream)

Callers 1

UpdateDependenciesMethod · 0.95

Calls 5

cmStrCatFunction · 0.70
FileExistsFunction · 0.50
GetDefinitionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected