diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFindBase.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 4ff14b6..5d58783 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -200,7 +200,9 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) { doing = DoingNone; compatibility = false; - newStyle = true; + // Some common arguments were accidentally supported by CMake + // 2.4 and 2.6.0 in the short-hand form of the command, so we + // must support it even though it is not documented. } else if(doing == DoingNames) { @@ -259,11 +261,13 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) // FIND_*(VAR name path1 path2 ...) if(!newStyle) { + // All the short-hand arguments have been recorded as names. + std::vector<std::string> shortArgs = this->Names; this->Names.clear(); // clear out any values in Names - this->Names.push_back(args[1]); - for(unsigned int j = 2; j < args.size(); ++j) + this->Names.push_back(shortArgs[0]); + for(unsigned int j = 1; j < shortArgs.size(); ++j) { - this->AddUserPath(args[j], this->UserPaths); + this->AddUserPath(shortArgs[j], this->UserPaths); } } this->ExpandPaths(); |