Pārlūkot izejas kodu

BUG: In find_* commands support NO_* options in short-hand

  - The short-hand forms do not document the NO_* options.
  - CMake 2.4 and 2.6.0 accepted them accidentally, but also
    treated the options as paths.
  - Now the options are accepted but do not become paths.
Brad King 17 gadi atpakaļ
vecāks
revīzija
4543a3ea05
1 mainītis faili ar 8 papildinājumiem un 4 dzēšanām
  1. 8 4
      Source/cmFindBase.cxx

+ 8 - 4
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();