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

Method Install

Source/cmFileCopier.cxx:441–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441bool cmFileCopier::Install(std::string const& fromFile,
442 std::string const& toFile)
443{
444 if (fromFile.empty()) {
445 this->Status.SetError(
446 "INSTALL encountered an empty string input file name.");
447 return false;
448 }
449
450 // Collect any properties matching this file name.
451 MatchProperties match_properties = this->CollectMatchProperties(fromFile);
452
453 // Skip the file if it is excluded.
454 if (match_properties.Exclude) {
455 return true;
456 }
457
458 if (cmSystemTools::SameFile(fromFile, toFile)) {
459 return true;
460 }
461
462 std::string newFromFile = fromFile;
463 std::string newToFile = toFile;
464
465 if (this->FollowSymlinkChain &&
466 !this->InstallSymlinkChain(newFromFile, newToFile)) {
467 return false;
468 }
469
470 if (cmSystemTools::FileIsSymlink(newFromFile)) {
471 return this->InstallSymlink(newFromFile, newToFile);
472 }
473 if (cmSystemTools::FileIsDirectory(newFromFile)) {
474 return this->InstallDirectory(newFromFile, newToFile, match_properties);
475 }
476 if (cmSystemTools::FileExists(newFromFile)) {
477 return this->InstallFile(newFromFile, newToFile, match_properties);
478 }
479 return this->ReportMissing(newFromFile);
480}
481
482bool cmFileCopier::InstallSymlinkChain(std::string& fromFile,
483 std::string& toFile)

Callers 3

RunMethod · 0.95
InstallDirectoryMethod · 0.95
do_installFunction · 0.45

Calls 9

InstallSymlinkChainMethod · 0.95
InstallSymlinkMethod · 0.95
InstallDirectoryMethod · 0.95
InstallFileMethod · 0.95
ReportMissingMethod · 0.95
FileExistsFunction · 0.50
emptyMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected