Index: Source/CPack/cmCPackPackageMakerGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackPackageMakerGenerator.cxx,v
retrieving revision 1.29
diff -u -r1.29 cmCPackPackageMakerGenerator.cxx
--- Source/CPack/cmCPackPackageMakerGenerator.cxx	1 Oct 2008 13:04:27 -0000	1.29
+++ Source/CPack/cmCPackPackageMakerGenerator.cxx	18 Mar 2009 10:54:16 -0000
@@ -287,30 +287,52 @@
     {
     // Use PackageMaker to build the package.
     cmOStringStream pkgCmd;
-    pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
-           << "\" -build -p \"" << packageDirFileName << "\"";
-    if (this->Components.empty())
+    if (this->PackageMakerVersion < 3.0)
       {
-      pkgCmd << " -f \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY");
+      pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
+             << "\" -build -p \"" << packageDirFileName << "\"";
+      if (this->Components.empty())
+        {
+        pkgCmd << " -f \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY");
+        }
+      else
+        {
+        pkgCmd << " -mi \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY")
+               << "/packages/";
+        }
+      pkgCmd << "\" -r \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
+             << "/Resources\" -i \""
+             << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") 
+             << "/Info.plist\" -d \""
+             << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
+             << "/Description.plist\"";
+      if ( this->PackageMakerVersion > 2.0 )
+        {
+        pkgCmd << " -v";
+        }
       }
     else
       {
-      pkgCmd << " -mi \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY")
-             << "/packages/";
+      // Use packagemaker 3 syntax where possible
+      std::string pkgId = "com.";
+      pkgId += this->GetOption("CPACK_PACKAGE_VENDOR");
+      pkgId += '.';
+      pkgId += this->GetOption("CPACK_PACKAGE_NAME");
+      
+      pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
+      << "\" --root \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY") << "\""
+      << " --resources \""  << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
+      << "/Resources\""
+      << " --version " << this->GetOption("CPACK_PACKAGE_VERSION")
+      << " --id " << pkgId
+      << " --target " << this->GetOption("CPACK_OSX_PACKAGE_VERSION")
+      << " --out \"" << packageDirFileName << "\""
+      << " -v";
       }
-    pkgCmd << "\" -r \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
-           << "/Resources\" -i \""
-           << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") 
-           << "/Info.plist\" -d \""
-           << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
-           << "/Description.plist\"";
-    if ( this->PackageMakerVersion > 2.0 )
-      {
-      pkgCmd << " -v";
+      
+      if (!RunPackageMaker(pkgCmd.str().c_str(), packageDirFileName.c_str()))
+        return 0;
       }
-    if (!RunPackageMaker(pkgCmd.str().c_str(), packageDirFileName.c_str()))
-      return 0;
-    }
   else
     {
     // We have built the package in place. Generate the
