| 38 | cmFileCopier::~cmFileCopier() = default; |
| 39 | |
| 40 | cmFileCopier::MatchProperties cmFileCopier::CollectMatchProperties( |
| 41 | std::string const& file) |
| 42 | { |
| 43 | // Match rules are case-insensitive on some platforms. |
| 44 | #if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__) |
| 45 | std::string const file_to_match = cmSystemTools::LowerCase(file); |
| 46 | #else |
| 47 | std::string const& file_to_match = file; |
| 48 | #endif |
| 49 | |
| 50 | // Collect properties from all matching rules. |
| 51 | bool matched = false; |
| 52 | MatchProperties result; |
| 53 | for (MatchRule& mr : this->MatchRules) { |
| 54 | if (mr.Regex.find(file_to_match)) { |
| 55 | matched = true; |
| 56 | result.Exclude |= mr.Properties.Exclude; |
| 57 | result.Permissions |= mr.Properties.Permissions; |
| 58 | } |
| 59 | } |
| 60 | if (!matched && !this->MatchlessFiles) { |
| 61 | result.Exclude = !cmSystemTools::FileIsDirectory(file); |
| 62 | } |
| 63 | return result; |
| 64 | } |
| 65 | |
| 66 | bool cmFileCopier::SetPermissions(std::string const& toFile, |
| 67 | mode_t permissions) |