浏览代码

CPack: Use real path to PackageMaker to find its version file (#12621)

On machines where a usr/bin/packagemaker symlink is found, we were
unable to find the version.plist file relative to the symlink.
Resolve the symlink first, so we can find it relative to the
real PackageMaker.
David Cole 13 年之前
父节点
当前提交
0f4dfa6960
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Source/CPack/cmCPackPackageMakerGenerator.cxx

+ 3 - 0
Source/CPack/cmCPackPackageMakerGenerator.cxx

@@ -402,6 +402,9 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
     this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str());
     this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str());
     }
     }
 
 
+  // Get path to the real PackageMaker, not a symlink:
+  pkgPath = cmSystemTools::GetRealPath(pkgPath.c_str());
+  // Up from there to find the version.plist file in the "Contents" dir:
   std::string contents_dir;
   std::string contents_dir;
   contents_dir = cmSystemTools::GetFilenamePath(pkgPath);
   contents_dir = cmSystemTools::GetFilenamePath(pkgPath);
   contents_dir = cmSystemTools::GetFilenamePath(contents_dir);
   contents_dir = cmSystemTools::GetFilenamePath(contents_dir);