[cmake-commits] alex committed bills-comments.txt 1.2 1.3 cmCPackGenericGenerator.cxx 1.43 1.44

cmake-commits at cmake.org cmake-commits at cmake.org
Fri May 18 14:41:11 EDT 2007


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

Modified Files:
	bills-comments.txt cmCPackGenericGenerator.cxx 
Log Message:

ENH: 2nd try to move stripping out of cpack and to install time, now if
CPACK_STRIP_FILES is true (or contains a list of files), everything will be
stripped, if it's empty or false they won't be stripped

Alex


Index: bills-comments.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/bills-comments.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bills-comments.txt	2 Feb 2007 19:40:25 -0000	1.2
+++ bills-comments.txt	18 May 2007 18:41:09 -0000	1.3
@@ -45,7 +45,7 @@
              - set CMAKE_INSTALL_PREFIX to the temp directory
              - CPACK_BUILD_CONFIG check this and set the BUILD_TYPE to it
               - ReadListFile on the install script  cmake_install.cmake
-         - run strip on the files in this var: CPACK_STRIP_FILES
+         - run strip on the executables and libraries if CPACK_STRIP_FILES is TRUE
 
 Recommendations:
 

Index: cmCPackGenericGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGenericGenerator.cxx,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- cmCPackGenericGenerator.cxx	2 Feb 2007 19:40:25 -0000	1.43
+++ cmCPackGenericGenerator.cxx	18 May 2007 18:41:09 -0000	1.44
@@ -135,12 +135,6 @@
     return 0;
     }
 
-  std::vector<std::string> path;
-  std::string pkgPath = cmSystemTools::FindProgram("strip", path, false);
-  if ( !pkgPath.empty() )
-    {
-    this->SetOptionIfNotSet("CPACK_STRIP_COMMAND", pkgPath.c_str());
-    }
   this->SetOptionIfNotSet("CPACK_REMOVE_TOPLEVEL_DIRECTORY", "1");
 
   return 1;
@@ -218,46 +212,6 @@
     cmSystemTools::PutEnv("DESTDIR=");
     }
 
-  const char* stripExecutable = this->GetOption("CPACK_STRIP_COMMAND");
-  const char* stripFiles
-    = this->GetOption("CPACK_STRIP_FILES");
-  if ( stripFiles && *stripFiles && stripExecutable && *stripExecutable )
-    {
-    cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Strip files" << std::endl);
-    std::vector<std::string> stripFilesVector;
-    cmSystemTools::ExpandListArgument(stripFiles,
-      stripFilesVector);
-    std::vector<std::string>::iterator it;
-    for ( it = stripFilesVector.begin();
-      it != stripFilesVector.end();
-      ++it )
-      {
-      std::string fileName = tempInstallDirectory;
-      fileName += "/" + *it;
-      fileName += cmSystemTools::GetExecutableExtension();
-      cmCPackLogger(cmCPackLog::LOG_VERBOSE,
-        "    Strip file: " << fileName.c_str()
-        << std::endl);
-      std::string stripCommand = stripExecutable;
-      stripCommand += " \"";
-      stripCommand += fileName + "\"";
-      int retVal = 1;
-      std::string output;
-      bool resB =
-        cmSystemTools::RunSingleCommand(stripCommand.c_str(), &output,
-                                        &retVal, 0,
-                                        this->GeneratorVerbose, 0);
-      if ( !resB || retVal )
-        {
-        cmCPackLogger(cmCPackLog::LOG_ERROR,
-          "Problem running install command: " << stripCommand.c_str()
-          << std::endl
-          << "Error was: \"" << output.c_str() << "\""
-          << std::endl);
-        return 0;
-        }
-      }
-    }
   return res;
 }
 
@@ -579,6 +533,13 @@
                           installComponent.c_str());
         }
 
+      // strip on TRUE, ON, 1, one or several file names, but not on 
+      // FALSE, OFF, 0 and an empty string
+      if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES")))
+        {
+        mf->AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
+        }
+
       int res = mf->ReadListFile(0, installFile.c_str());
       if ( cmSystemTools::GetErrorOccuredFlag() || !res )
         {



More information about the Cmake-commits mailing list