[cmake-commits] hoffman committed cmCPackGenericGenerator.cxx 1.25.2.5 1.25.2.6 cmCPackGenericGenerator.h 1.10.2.2 1.10.2.3 cmCPackNSISGenerator.cxx 1.13.2.4 1.13.2.5 cmCPackTGZGenerator.cxx 1.13.2.1 1.13.2.2 cpack.cxx 1.16.2.5 1.16.2.6

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 27 16:01:51 EDT 2006


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

Modified Files:
      Tag: CMake-2-4
	cmCPackGenericGenerator.cxx cmCPackGenericGenerator.h 
	cmCPackNSISGenerator.cxx cmCPackTGZGenerator.cxx cpack.cxx 
Log Message:
ENH: move changes from main tree


Index: cmCPackTGZGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackTGZGenerator.cxx,v
retrieving revision 1.13.2.1
retrieving revision 1.13.2.2
diff -u -d -r1.13.2.1 -r1.13.2.2
--- cmCPackTGZGenerator.cxx	7 May 2006 14:55:39 -0000	1.13.2.1
+++ cmCPackTGZGenerator.cxx	27 Oct 2006 20:01:49 -0000	1.13.2.2
@@ -26,7 +26,7 @@
 #include "cmCPackLog.h"
 
 #include <cmsys/SystemTools.hxx>
-#include <cmzlib/zutil.h>
+#include <cm_zlib.h>
 #include <libtar/libtar.h>
 #include <memory> // auto_ptr
 #include <fcntl.h>
@@ -94,7 +94,7 @@
     mydata->ZLibStream.opaque = Z_NULL;
     int strategy = Z_DEFAULT_STRATEGY;
     if ( deflateInit2(&mydata->ZLibStream, mydata->CompressionLevel,
-        Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy) != Z_OK )
+        Z_DEFLATED, -MAX_WBITS, 8, strategy) != Z_OK )
       {
       return -1;
       }
@@ -281,7 +281,8 @@
     const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
     char header[11];
     sprintf(header, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
-      Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
+            Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/,
+            3 /* zlib os code for UNIX, not really used anyway */);
     os->write(header, 10);
     }
   return 1;

Index: cmCPackGenericGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGenericGenerator.cxx,v
retrieving revision 1.25.2.5
retrieving revision 1.25.2.6
diff -u -d -r1.25.2.5 -r1.25.2.6
--- cmCPackGenericGenerator.cxx	24 Jul 2006 15:19:36 -0000	1.25.2.5
+++ cmCPackGenericGenerator.cxx	27 Oct 2006 20:01:49 -0000	1.25.2.6
@@ -184,6 +184,14 @@
     return 0;
     }
 
+  // If the CPackConfig file sets CPACK_INSTALL_SCRIPT then run them
+  // as listed
+  if ( !this->InstallProjectViaInstallScript(
+      movable, tempInstallDirectory) )
+    {
+    return 0;
+    }
+
   // If the CPackConfig file sets CPACK_INSTALLED_DIRECTORIES
   // then glob it and copy it to CPACK_TEMPORARY_DIRECTORY
   // This is used in Source packageing
@@ -258,6 +266,9 @@
   const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
   if ( installCommands && *installCommands )
     {
+    std::string tempInstallDirectoryEnv = "CMAKE_INSTALL_PREFIX=";
+    tempInstallDirectoryEnv += tempInstallDirectory;
+    cmSystemTools::PutEnv(tempInstallDirectoryEnv.c_str());
     std::vector<std::string> installCommandsVector;
     cmSystemTools::ExpandListArgument(installCommands,installCommandsVector);
     std::vector<std::string>::iterator it;
@@ -391,6 +402,48 @@
 }
 
 //----------------------------------------------------------------------
+int cmCPackGenericGenerator::InstallProjectViaInstallScript(
+  bool movable, const char* tempInstallDirectory)
+{
+  const char* cmakeScripts
+    = this->GetOption("CPACK_INSTALL_SCRIPT");
+  std::string currentWorkingDirectory =
+    cmSystemTools::GetCurrentWorkingDirectory();
+  cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+    "- Install scripts: " << cmakeScripts << std::endl);
+  if ( cmakeScripts && *cmakeScripts )
+    {
+    std::vector<std::string> cmakeScriptsVector;
+    cmSystemTools::ExpandListArgument(cmakeScripts,
+      cmakeScriptsVector);
+    std::vector<std::string>::iterator it;
+    for ( it = cmakeScriptsVector.begin();
+      it != cmakeScriptsVector.end();
+      ++it )
+      {
+      std::string installScript = it->c_str();
+
+      cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+        "- Install script: " << installScript << std::endl);
+      if ( movable )
+        {
+        this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory);
+        }
+      this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR",
+        tempInstallDirectory);
+      this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
+        tempInstallDirectory);
+      int res = this->MakefileMap->ReadListFile(0, installScript.c_str());
+      if ( cmSystemTools::GetErrorOccuredFlag() || !res )
+        {
+        return 0;
+        }
+      }
+    }
+  return 1;
+}
+
+//----------------------------------------------------------------------
 int cmCPackGenericGenerator::InstallProjectViaInstallCMakeProjects(
   bool movable, const char* tempInstallDirectory)
 {
@@ -535,7 +588,8 @@
 void cmCPackGenericGenerator::SetOptionIfNotSet(const char* op,
   const char* value)
 {
-  if ( this->MakefileMap->GetDefinition(op) )
+  const char* def = this->MakefileMap->GetDefinition(op);
+  if ( def && *def )
     {
     return;
     }

Index: cpack.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cpack.cxx,v
retrieving revision 1.16.2.5
retrieving revision 1.16.2.6
diff -u -d -r1.16.2.5 -r1.16.2.6
--- cpack.cxx	13 Oct 2006 14:52:07 -0000	1.16.2.5
+++ cpack.cxx	27 Oct 2006 20:01:49 -0000	1.16.2.6
@@ -301,6 +301,12 @@
       globalMF->AddDefinition(cdit->first.c_str(), cdit->second.c_str());
       }
 
+    const char* cpackModulesPath =
+      globalMF->GetDefinition("CPACK_MODULE_PATH");
+    if ( cpackModulesPath )
+      {
+      globalMF->AddDefinition("CMAKE_MODULE_PATH", cpackModulesPath);
+      }
     const char* genList = globalMF->GetDefinition("CPACK_GENERATOR");
     if ( !genList )
       {

Index: cmCPackNSISGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v
retrieving revision 1.13.2.4
retrieving revision 1.13.2.5
diff -u -d -r1.13.2.4 -r1.13.2.5
--- cmCPackNSISGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.13.2.4
+++ cmCPackNSISGenerator.cxx	27 Oct 2006 20:01:49 -0000	1.13.2.5
@@ -232,6 +232,7 @@
     this->SetOptionIfNotSet("CPACK_NSIS_DELETE_ICONS", 
                             deleteStr.str().c_str());
     }
+  this->SetOptionIfNotSet("CPACK_NSIS_COMPRESSOR", "lzma");
 
   return this->Superclass::InitializeInternal();
 }

Index: cmCPackGenericGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGenericGenerator.h,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -d -r1.10.2.2 -r1.10.2.3
--- cmCPackGenericGenerator.h	24 Jul 2006 15:19:36 -0000	1.10.2.2
+++ cmCPackGenericGenerator.h	27 Oct 2006 20:01:49 -0000	1.10.2.3
@@ -110,6 +110,8 @@
   //! Run install commands if specified
   virtual int InstallProjectViaInstallCommands(
     bool movable, const char* tempInstallDirectory);
+  virtual int InstallProjectViaInstallScript(
+    bool movable, const char* tempInstallDirectory);
   virtual int InstallProjectViaInstalledDirectories(
     bool movable, const char* tempInstallDirectory);
   virtual int InstallProjectViaInstallCMakeProjects(



More information about the Cmake-commits mailing list