浏览代码

COMP: Fix ConvertToRelativePath change for Xcode generator.

Brad King 18 年之前
父节点
当前提交
073076e0f7
共有 2 个文件被更改,包括 14 次插入12 次删除
  1. 4 2
      Source/cmGlobalXCodeGenerator.cxx
  2. 10 10
      Source/cmLocalGenerator.h

+ 4 - 2
Source/cmGlobalXCodeGenerator.cxx

@@ -2539,7 +2539,8 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeForMake(const char* p)
   else
     {
     std::string ret = 
-      this->ConvertToRelativePath(this->CurrentOutputDirectoryComponents, p);
+      this->CurrentLocalGenerator->
+        ConvertToRelativePath(this->CurrentOutputDirectoryComponents, p);
     return cmSystemTools::ConvertToOutputPath(ret.c_str());
     }
 }
@@ -2554,7 +2555,8 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeForXCode(const char* p)
   else
     {
     std::string ret = 
-      this->ConvertToRelativePath(this->ProjectOutputDirectoryComponents, p);
+      this->CurrentLocalGenerator->
+        ConvertToRelativePath(this->ProjectOutputDirectoryComponents, p);
     return cmSystemTools::ConvertToOutputPath(ret.c_str());
     }
 }

+ 10 - 10
Source/cmLocalGenerator.h

@@ -219,6 +219,16 @@ public:
   // return the source name for the object file
   virtual std::string GetSourceObjectName(cmSourceFile& );
   
+  /**
+   * Convert the given remote path to a relative path with respect to
+   * the given local path.  The local path must be given in component
+   * form (see SystemTools::SplitPath) without a trailing slash.  The
+   * remote path must use forward slashes and not already be escaped
+   * or quoted.
+   */
+  std::string ConvertToRelativePath(const std::vector<std::string>& local,
+                                    const char* remote);
+
 protected:
 
   /** Construct a comment for a custom command.  */
@@ -268,16 +278,6 @@ protected:
 
   void ConfigureRelativePaths();
 
-  /**
-   * Convert the given remote path to a relative path with respect to
-   * the given local path.  The local path must be given in component
-   * form (see SystemTools::SplitPath) without a trailing slash.  The
-   * remote path must use forward slashes and not already be escaped
-   * or quoted.
-   */
-  std::string ConvertToRelativePath(const std::vector<std::string>& local,
-                                    const char* remote);
-
   cmMakefile *Makefile;
   cmGlobalGenerator *GlobalGenerator;
   // members used for relative path function ConvertToMakefilePath