diff options
Diffstat (limited to 'Source/cmFindProgramCommand.cxx')
-rw-r--r-- | Source/cmFindProgramCommand.cxx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 1c87625..780b256 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -104,6 +104,26 @@ struct cmFindProgramHelper } bool FileIsExecutable(std::string const& file) const { +#ifdef _WIN32 + if (!this->FileIsExecutableCMP0109(file)) { + return false; + } + // Pretend the Windows "python" app installer alias does not exist. + if (cmSystemTools::LowerCase(file).find("/windowsapps/python") != + std::string::npos) { + std::string dest; + if (cmSystemTools::ReadSymlink(file, dest) && + cmHasLiteralSuffix(dest, "\\AppInstallerPythonRedirector.exe")) { + return false; + } + } + return true; +#else + return this->FileIsExecutableCMP0109(file); +#endif + } + bool FileIsExecutableCMP0109(std::string const& file) const + { switch (this->PolicyCMP0109) { case cmPolicies::OLD: return cmSystemTools::FileExists(file, true); @@ -157,13 +177,14 @@ cmFindProgramCommand::cmFindProgramCommand(cmExecutionStatus& status) // cmFindProgramCommand bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn) { - this->DebugMode = this->ComputeIfDebugModeWanted(); + this->CMakePathName = "PROGRAM"; // call cmFindBase::ParseArguments if (!this->ParseArguments(argsIn)) { return false; } + this->DebugMode = this->ComputeIfDebugModeWanted(this->VariableName); if (this->AlreadyDefined) { this->NormalizeFindResult(); |