ソースを参照

BUG: fix #6105, if a directory inside CMAKE_FIND_ROOT_PATH is given to a
FIND_XXX() command, don't prepend the root to it (since it is already in
this root)

Alex

Alexander Neundorf 18 年 前
コミット
9aeffa6e11
1 ファイル変更12 行追加2 行削除
  1. 12 2
      Source/cmFindBase.cxx

+ 12 - 2
Source/cmFindBase.cxx

@@ -536,8 +536,18 @@ void cmFindBase::HandleCMakeFindRootPath()
        it != unrootedPaths.end();
        ++it )
       {
-      std::string rootedDir=*rootIt;
-      rootedDir+=*it;
+      // if the current directory is already inside the current root, don't
+      // add the root again
+      std::string rootedDir;
+      if (cmSystemTools::IsSubDirectory(it->c_str(), rootIt->c_str()))
+        {
+        rootedDir = *it;
+        }
+      else
+        {
+        rootedDir=*rootIt;
+        rootedDir+=*it;
+        }
       this->SearchPaths.push_back(rootedDir);
       }
     }