[Cmake-commits] [cmake-commits] hoffman committed cmCPackBundleGenerator.cxx 1.2.2.5 1.2.2.6 cmCPackBundleGenerator.h 1.1.2.2 1.1.2.3 cmCPackGeneratorFactory.cxx 1.2.2.1 1.2.2.2 cmCPackLog.cxx 1.7 1.7.12.1 cmCPackNSISGenerator.cxx 1.31.2.3 1.31.2.4 cmCPackOSXX11Generator.cxx 1.5 1.5.2.1 cpack.cxx 1.42.2.2 1.42.2.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Feb 4 11:44:20 EST 2009


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv32179/Source/CPack

Modified Files:
      Tag: CMake-2-6
	cmCPackBundleGenerator.cxx cmCPackBundleGenerator.h 
	cmCPackGeneratorFactory.cxx cmCPackLog.cxx 
	cmCPackNSISGenerator.cxx cmCPackOSXX11Generator.cxx cpack.cxx 
Log Message:
ENH: merge in changes to 2.6 RC 10


Index: cmCPackBundleGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackBundleGenerator.cxx,v
retrieving revision 1.2.2.5
retrieving revision 1.2.2.6
diff -C 2 -d -r1.2.2.5 -r1.2.2.6
*** cmCPackBundleGenerator.cxx	31 Dec 2008 15:14:30 -0000	1.2.2.5
--- cmCPackBundleGenerator.cxx	4 Feb 2009 16:44:18 -0000	1.2.2.6
***************
*** 20,23 ****
--- 20,25 ----
  #include "cmSystemTools.h"
  
+ #include <cmsys/RegularExpression.hxx>
+ 
  //----------------------------------------------------------------------
  cmCPackBundleGenerator::cmCPackBundleGenerator()
***************
*** 33,57 ****
  int cmCPackBundleGenerator::InitializeInternal()
  {
!   const std::string hdiutil_path = cmSystemTools::FindProgram("hdiutil",
!     std::vector<std::string>(), false);
!   if(hdiutil_path.empty())
      {
      cmCPackLogger(cmCPackLog::LOG_ERROR,
!       "Cannot locate hdiutil command"
        << std::endl);
-     return 0;
-     }
-   this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path.c_str());
  
-   const std::string setfile_path = cmSystemTools::FindProgram("SetFile",
-     std::vector<std::string>(1, "/Developer/Tools"), false);
-   if(setfile_path.empty())
-     {
-     cmCPackLogger(cmCPackLog::LOG_ERROR,
-       "Cannot locate SetFile command"
-       << std::endl);
      return 0;
      }
-   this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str());
  
    return this->Superclass::InitializeInternal();
--- 35,47 ----
  int cmCPackBundleGenerator::InitializeInternal()
  {
!   const char* name = this->GetOption("CPACK_BUNDLE_NAME");
!   if(0 == name)
      {
      cmCPackLogger(cmCPackLog::LOG_ERROR,
!       "CPACK_BUNDLE_NAME must be set to use the Bundle generator."
        << std::endl);
  
      return 0;
      }
  
    return this->Superclass::InitializeInternal();
***************
*** 59,68 ****
  
  //----------------------------------------------------------------------
- const char* cmCPackBundleGenerator::GetOutputExtension()
- {
-   return ".dmg";
- }
- 
- //----------------------------------------------------------------------
  const char* cmCPackBundleGenerator::GetPackagingInstallPrefix()
  {
--- 49,52 ----
***************
*** 246,259 ****
      {
      cmOStringStream temp_mount;
-     temp_mount << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/mnt";
-     cmSystemTools::MakeDirectory(temp_mount.str().c_str());
  
      cmOStringStream attach_command;
      attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
      attach_command << " attach";
-     attach_command << " -mountpoint \"" << temp_mount.str() << "\"";
      attach_command << " \"" << temp_image.str() << "\"";
  
!     if(!this->RunCommand(attach_command))
        {
        cmCPackLogger(cmCPackLog::LOG_ERROR,
--- 230,241 ----
      {
      cmOStringStream temp_mount;
  
      cmOStringStream attach_command;
      attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
      attach_command << " attach";
      attach_command << " \"" << temp_image.str() << "\"";
  
!     std::string attach_output;
!     if(!this->RunCommand(attach_command, &attach_output))
        {
        cmCPackLogger(cmCPackLog::LOG_ERROR,
***************
*** 264,267 ****
--- 246,253 ----
        }
  
+     cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*");
+     mountpoint_regex.find(attach_output.c_str());
+     temp_mount << mountpoint_regex.match(1);
+ 
      cmOStringStream setfile_command;
      setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
***************
*** 313,362 ****
    return 1;
  }
- 
- //----------------------------------------------------------------------
- bool cmCPackBundleGenerator::CopyFile(cmOStringStream& source,
-   cmOStringStream& target)
- {
-   if(!cmSystemTools::CopyFileIfDifferent(
-     source.str().c_str(),
-     target.str().c_str()))
-     {
-     cmCPackLogger(cmCPackLog::LOG_ERROR,
-       "Error copying "
-       << source.str()
-       << " to "
-       << target.str()
-       << std::endl);
- 
-     return false;
-     }
- 
-   return true;
- }
- 
- //----------------------------------------------------------------------
- bool cmCPackBundleGenerator::RunCommand(cmOStringStream& command)
- {
-   std::string output;
-   int exit_code = 1;
- 
-   bool result = cmSystemTools::RunSingleCommand(
-     command.str().c_str(),
-     &output,
-     &exit_code,
-     0,
-     this->GeneratorVerbose,
-     0);
- 
-   if(!result || exit_code)
-     {
-     cmCPackLogger(cmCPackLog::LOG_ERROR,
-       "Error executing: "
-       << command.str()
-       << std::endl);
- 
-     return false;
-     }
- 
-   return true;
- }
--- 299,300 ----

Index: cmCPackGeneratorFactory.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGeneratorFactory.cxx,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C 2 -d -r1.2.2.1 -r1.2.2.2
*** cmCPackGeneratorFactory.cxx	25 Jun 2008 13:51:39 -0000	1.2.2.1
--- cmCPackGeneratorFactory.cxx	4 Feb 2009 16:44:18 -0000	1.2.2.2
***************
*** 26,29 ****
--- 26,30 ----
  #include "cmCPackNSISGenerator.h"
  #ifdef __APPLE__
+ #  include "cmCPackDragNDropGenerator.h"
  #  include "cmCPackBundleGenerator.h"
  #  include "cmCPackPackageMakerGenerator.h"
***************
*** 68,71 ****
--- 69,74 ----
      cmCPackTarCompressGenerator::CreateGenerator);
  #ifdef __APPLE__
+   this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop",
+     cmCPackDragNDropGenerator::CreateGenerator);
    this->RegisterGenerator("Bundle", "Mac OSX bundle",
      cmCPackBundleGenerator::CreateGenerator);

Index: cmCPackOSXX11Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackOSXX11Generator.cxx,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C 2 -d -r1.5 -r1.5.2.1
*** cmCPackOSXX11Generator.cxx	31 Oct 2007 12:50:17 -0000	1.5
--- cmCPackOSXX11Generator.cxx	4 Feb 2009 16:44:18 -0000	1.5.2.1
***************
*** 90,97 ****
--- 90,102 ----
    std::string resourcesDirectory = contentsDirectory + "/Resources";
    std::string appDirectory = contentsDirectory + "/MacOS";
+   std::string scriptDirectory = resourcesDirectory + "/Scripts";
+   std::string resourceFileName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
+   resourceFileName += ".rsrc";
  
    const char* dir = resourcesDirectory.c_str();
    const char* appdir = appDirectory.c_str();
+   const char* scrDir = scriptDirectory.c_str();
    const char* contDir = contentsDirectory.c_str();
+   const char* rsrcFile = resourceFileName.c_str();
    const char* iconFile = this->GetOption("CPACK_PACKAGE_ICON");
    if ( iconFile )
***************
*** 125,128 ****
--- 130,137 ----
      !this->CopyResourcePlistFile("OSXX11.Info.plist", contDir,
        "Info.plist" ) ||
+     !this->CopyResourcePlistFile("OSXX11.main.scpt", scrDir,
+       "main.scpt", true ) ||
+     !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir, 
+       rsrcFile, true) ||
      !this->CopyResourcePlistFile("OSXScriptLauncher", appdir, 
        this->GetOption("CPACK_PACKAGE_FILE_NAME"), true)

Index: cmCPackBundleGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackBundleGenerator.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C 2 -d -r1.1.2.2 -r1.1.2.3
*** cmCPackBundleGenerator.h	25 Jun 2008 13:51:33 -0000	1.1.2.2
--- cmCPackBundleGenerator.h	4 Feb 2009 16:44:18 -0000	1.1.2.3
***************
*** 19,23 ****
  #define cmCPackBundleGenerator_h
  
! #include "cmCPackGenerator.h"
  
  /** \class cmCPackBundleGenerator
--- 19,23 ----
  #define cmCPackBundleGenerator_h
  
! #include "cmCPackDragNDropGenerator.h"
  
  /** \class cmCPackBundleGenerator
***************
*** 26,33 ****
   * Based on Gimp.app
   */
! class cmCPackBundleGenerator : public cmCPackGenerator
  {
  public:
!   cmCPackTypeMacro(cmCPackBundleGenerator, cmCPackGenerator);
  
    cmCPackBundleGenerator();
--- 26,33 ----
   * Based on Gimp.app
   */
! class cmCPackBundleGenerator : public cmCPackDragNDropGenerator
  {
  public:
!   cmCPackTypeMacro(cmCPackBundleGenerator, cmCPackDragNDropGenerator);
  
    cmCPackBundleGenerator();
***************
*** 36,47 ****
  protected:
    virtual int InitializeInternal();
-   virtual const char* GetOutputExtension();
    virtual const char* GetPackagingInstallPrefix();
    int CompressFiles(const char* outFileName, const char* toplevel,
      const std::vector<std::string>& files);
  
-   bool CopyFile(cmOStringStream& source, cmOStringStream& target);
-   bool RunCommand(cmOStringStream& command);
- 
    std::string InstallPrefix;
  };
--- 36,43 ----

Index: cpack.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cpack.cxx,v
retrieving revision 1.42.2.2
retrieving revision 1.42.2.3
diff -C 2 -d -r1.42.2.2 -r1.42.2.3
*** cpack.cxx	24 Sep 2008 14:07:50 -0000	1.42.2.2
--- cpack.cxx	4 Feb 2009 16:44:18 -0000	1.42.2.3
***************
*** 475,478 ****
--- 475,483 ----
      }
  
+   if (cmSystemTools::GetErrorOccuredFlag())
+     {
+     return 1;
+     }
+ 
    return 0;
  }

Index: cmCPackLog.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackLog.cxx,v
retrieving revision 1.7
retrieving revision 1.7.12.1
diff -C 2 -d -r1.7 -r1.7.12.1
*** cmCPackLog.cxx	10 Mar 2006 18:06:26 -0000	1.7
--- cmCPackLog.cxx	4 Feb 2009 16:44:18 -0000	1.7.12.1
***************
*** 19,22 ****
--- 19,23 ----
  
  #include "cmGeneratedFileStream.h"
+ #include "cmSystemTools.h"
  
  //----------------------------------------------------------------------
***************
*** 222,224 ****
--- 223,230 ----
      this->NewLine = true;
      }
+ 
+   if ( error )
+     {
+     cmSystemTools::SetErrorOccured();
+     }
  }

Index: cmCPackNSISGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v
retrieving revision 1.31.2.3
retrieving revision 1.31.2.4
diff -C 2 -d -r1.31.2.3 -r1.31.2.4
*** cmCPackNSISGenerator.cxx	24 Oct 2008 15:18:55 -0000	1.31.2.3
--- cmCPackNSISGenerator.cxx	4 Feb 2009 16:44:18 -0000	1.31.2.4
***************
*** 794,811 ****
              << component->Name << "\n";
    std::vector<std::string>::iterator pathIt;
!   for (pathIt = component->Files.begin(); 
!        pathIt != component->Files.end(); 
!        ++pathIt) 
      {
!     macrosOut << "  Delete \"$INSTDIR\\" 
!               << cmSystemTools::ConvertToWindowsOutputPath(pathIt->c_str())
                << "\"\n";
      }
!   for (pathIt = component->Directories.begin(); 
!        pathIt != component->Directories.end(); 
!        ++pathIt) 
      {
!     macrosOut << "  RMDir \"$INSTDIR\\" 
!               << cmSystemTools::ConvertToWindowsOutputPath(pathIt->c_str())
                << "\"\n";
      }
--- 794,816 ----
              << component->Name << "\n";
    std::vector<std::string>::iterator pathIt;
!   std::string path;
!   for (pathIt = component->Files.begin();
!        pathIt != component->Files.end();
!        ++pathIt)
      {
!     path = *pathIt;
!     cmSystemTools::ReplaceString(path, "/", "\\");
!     macrosOut << "  Delete \"$INSTDIR\\"
!               << path.c_str()
                << "\"\n";
      }
!   for (pathIt = component->Directories.begin();
!        pathIt != component->Directories.end();
!        ++pathIt)
      {
!     path = *pathIt;
!     cmSystemTools::ReplaceString(path, "/", "\\");
!     macrosOut << "  RMDir \"$INSTDIR\\"
!               << path.c_str()
                << "\"\n";
      }



More information about the Cmake-commits mailing list