[cmake-commits] alex committed cmInstallTargetGenerator.cxx 1.29 1.30

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 17 17:21:54 EDT 2007


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

Modified Files:
	cmInstallTargetGenerator.cxx 
Log Message:
STYLE: fix indentation
ENH: add hack to make new cmake work with older existing cmake build trees

Alex


Index: cmInstallTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetGenerator.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cmInstallTargetGenerator.cxx	17 May 2007 17:20:44 -0000	1.29
+++ cmInstallTargetGenerator.cxx	17 May 2007 21:21:52 -0000	1.30
@@ -172,19 +172,18 @@
   // Fix the install_name settings in installed binaries.
   if((type == cmTarget::SHARED_LIBRARY ||
      type == cmTarget::MODULE_LIBRARY ||
-     type == cmTarget::EXECUTABLE) &&
-     this->Target->GetMakefile()->IsSet("CMAKE_INSTALL_NAME_TOOL"))
+     type == cmTarget::EXECUTABLE))
     {
     this->AddInstallNamePatchRule(os, destination.c_str());
     }
 
-    std::string destinationFilename = destination;
-    destinationFilename += "/";
-    destinationFilename += cmSystemTools::GetFilenameName(fromFile);
+  std::string destinationFilename = destination;
+  destinationFilename += "/";
+  destinationFilename += cmSystemTools::GetFilenameName(fromFile);
 
-    this->AddRanlibRule(os, type, destinationFilename);
+  this->AddRanlibRule(os, type, destinationFilename);
 
-    this->AddStripRule(os, destinationFilename);
+  this->AddStripRule(os, destinationFilename);
 }
 
 //----------------------------------------------------------------------------
@@ -347,6 +346,22 @@
 ::AddInstallNamePatchRule(std::ostream& os,
                           const char* destination)
 {
+  std::string installNameTool = this->Target->GetMakefile()->GetDefinition(
+                                "CMAKE_INSTALL_NAME_TOOL");
+  
+  // hack: if a new cmake runs on an old build tree, CMAKE_INSTALL_NAME_TOOL
+  // isn't in the cache, because it was simply hardcoded. To make this work
+  // adjust it here.
+  if((this->Target->GetMakefile()->IsOn("APPLE")) && (!installNameTool.size()))
+    {
+    installNameTool = "install_name_tool";
+    }
+
+  if(!installNameTool.size())
+    {
+    return;
+    }
+
   // Build a map of build-tree install_name to install-tree install_name for
   // shared libraries linked to this target.
   std::map<cmStdString, cmStdString> install_name_remap;
@@ -425,8 +440,7 @@
     component_test += this->Component;
     component_test += ")$\"";
     os << "IF(" << component_test << ")\n";
-    os << "  EXECUTE_PROCESS(COMMAND \"";
-    os <<this->Target->GetMakefile()->GetDefinition("CMAKE_INSTALL_NAME_TOOL");
+    os << "  EXECUTE_PROCESS(COMMAND \"" << installNameTool;
     os << "\"";
     if(!new_id.empty())
       {



More information about the Cmake-commits mailing list