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

Method FileIsExecutableCMP0109

Source/cmFindProgramCommand.cxx:130–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 return true;
129 }
130 bool FileIsExecutableCMP0109(std::string const& file) const
131 {
132 switch (this->PolicyCMP0109) {
133 case cmPolicies::OLD:
134 return cmSystemTools::FileExists(file, true);
135 case cmPolicies::NEW:
136 return cmSystemTools::FileIsExecutable(file);
137 default:
138 break;
139 }
140 bool const isExeOld = cmSystemTools::FileExists(file, true);
141 bool const isExeNew = cmSystemTools::FileIsExecutable(file);
142 if (isExeNew == isExeOld) {
143 return isExeNew;
144 }
145 if (isExeNew) {
146 this->Makefile->IssueMessage(
147 MessageType::AUTHOR_WARNING,
148 cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109),
149 "\n"
150 "The file\n"
151 " ",
152 file,
153 "\n"
154 "is executable but not readable. "
155 "CMake is ignoring it for compatibility."));
156 } else {
157 this->Makefile->IssueMessage(
158 MessageType::AUTHOR_WARNING,
159 cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109),
160 "\n"
161 "The file\n"
162 " ",
163 file,
164 "\n"
165 "is readable but not executable. "
166 "CMake is using it for compatibility."));
167 }
168 return isExeOld;
169 }
170};
171
172cmFindProgramCommand::cmFindProgramCommand(cmExecutionStatus& status)

Callers 1

FileIsExecutableMethod · 0.95

Calls 3

cmStrCatFunction · 0.70
FileExistsFunction · 0.50
IssueMessageMethod · 0.45

Tested by

no test coverage detected