Ver Fonte

Source: Avoid using CollapseFullPath just to get parent directory

Brad King há 2 anos atrás
pai
commit
a9ad70de76

+ 1 - 1
Source/CPack/cmCPackDebGenerator.cxx

@@ -225,7 +225,7 @@ bool DebGenerator::generateDataTar() const
       // XXX/application/usr/bin/myprogram with GEN_WDIR=XXX/application
       // should not add XXX/application
       orderedFiles.insert(currentPath);
-      currentPath = cmSystemTools::CollapseFullPath("..", currentPath);
+      currentPath = cmSystemTools::GetFilenamePath(currentPath);
     }
   }
 

+ 1 - 2
Source/CPack/cmCPackFreeBSDGenerator.cxx

@@ -405,8 +405,7 @@ int cmCPackFreeBSDGenerator::PackageFiles()
     return 0;
   }
 
-  const std::string output_dir =
-    cmSystemTools::CollapseFullPath("../", toplevel);
+  const std::string output_dir = cmSystemTools::GetFilenamePath(toplevel);
   PkgCreate package(output_dir, toplevel, manifestname);
   if (package.isValid()) {
     if (!package.Create()) {

+ 1 - 2
Source/cmLocalGenerator.cxx

@@ -909,8 +909,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
   for (std::string const& i : includes) {
     if (cmNonempty(fwSearchFlag) && this->Makefile->IsOn("APPLE") &&
         cmSystemTools::IsPathToFramework(i)) {
-      std::string const frameworkDir =
-        cmSystemTools::CollapseFullPath(cmStrCat(i, "/../"));
+      std::string const frameworkDir = cmSystemTools::GetFilenamePath(i);
       if (emitted.insert(frameworkDir).second) {
         if (sysFwSearchFlag && target &&
             target->IsSystemIncludeDirectory(frameworkDir, config, lang)) {