BUG: Directory installation pattern matching should be case insensitive on some platforms.

This commit is contained in:
Brad King 2006-08-21 17:47:51 -04:00
parent 08398a9f0c
commit c99dcc30be
2 changed files with 12 additions and 0 deletions

View File

@ -400,6 +400,13 @@ public:
// Get the properties from rules matching this input file. // Get the properties from rules matching this input file.
MatchProperties CollectMatchProperties(const char* file) MatchProperties CollectMatchProperties(const char* file)
{ {
// Match rules are case-insensitive on some platforms.
#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
std::string lower = cmSystemTools::LowerCase(file);
file = lower.c_str();
#endif
// Collect properties from all matching rules.
MatchProperties result; MatchProperties result;
for(std::vector<MatchRule>::iterator mr = this->MatchRules.begin(); for(std::vector<MatchRule>::iterator mr = this->MatchRules.begin();
mr != this->MatchRules.end(); ++mr) mr != this->MatchRules.end(); ++mr)

View File

@ -938,7 +938,12 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
else if(doing_regex) else if(doing_regex)
{ {
literal_args += " REGEX \""; literal_args += " REGEX \"";
// Match rules are case-insensitive on some platforms.
#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
std::string regex = cmSystemTools::LowerCase(args[i]);
#else
std::string regex = args[i]; std::string regex = args[i];
#endif
cmSystemTools::ReplaceString(regex, "\\", "\\\\"); cmSystemTools::ReplaceString(regex, "\\", "\\\\");
literal_args += regex; literal_args += regex;
literal_args += "\""; literal_args += "\"";