[cmake-commits] alex committed cmCPackGenericGenerator.cxx 1.43.2.1 1.43.2.2

cmake-commits at cmake.org cmake-commits at cmake.org
Mon May 14 16:28:09 EDT 2007


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

Modified Files:
      Tag: CMake-CrossCompileBasic
	cmCPackGenericGenerator.cxx 
Log Message:

ENH: move stripping from cpack to cmake/install time, fully configurable via
the CMAKE_STRIP_FILE rule, currently only implemented for the GNU toolchain.
Now cpack should work also for cross compiling (since it doesn't have to
know the executable suffix anymore).

stripping can be enabled/disabled via the cache variable CMAKE_INSTALL_DO_STRIP.

Even if this is disabled, the cmake_install.cmake files still contain the
strip rules, so by running cmake -DCMAKE_INSTALL_DO_STRIP=1
cmake_install.cmake you can install with stripping also in this case.

Alex


Index: cmCPackGenericGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGenericGenerator.cxx,v
retrieving revision 1.43.2.1
retrieving revision 1.43.2.2
diff -u -d -r1.43.2.1 -r1.43.2.2
--- cmCPackGenericGenerator.cxx	11 May 2007 17:46:02 -0000	1.43.2.1
+++ cmCPackGenericGenerator.cxx	14 May 2007 20:28:07 -0000	1.43.2.2
@@ -217,47 +217,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 += this->GetOption("CPACK_EXECUTABLE_SUFFIX");
-      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;
 }
 
@@ -571,6 +530,10 @@
         {
         mf->AddDefinition("BUILD_TYPE", buildConfig);
         }
+      if (this->GetOption("CPACK_DO_STRIP"))
+        {
+        mf->AddDefinition("CMAKE_INSTALL_DO_STRIP", this->GetOption("CPACK_DO_STRIP"));
+        }
       std::string installComponentLowerCase
         = cmSystemTools::LowerCase(installComponent);
       if ( installComponentLowerCase != "all" )



More information about the Cmake-commits mailing list