[cmake-commits] king committed cmInstallTargetGenerator.cxx 1.55 1.56 cmTarget.h 1.103 1.104

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Feb 1 13:08:14 EST 2008


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

Modified Files:
	cmInstallTargetGenerator.cxx cmTarget.h 
Log Message:
BUG: Remove InstallNameFixupPath from cmTarget and cmInstallTargetGenerator.

  - Motivation:
    - It depended on the order of installation
    - It supported only a single destination for each target
    - It created directory portions of an install name without user request
  - Updated ExportImport test to install targets in an order that expoed
    this bug


Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- cmTarget.h	31 Jan 2008 20:45:31 -0000	1.103
+++ cmTarget.h	1 Feb 2008 18:08:12 -0000	1.104
@@ -191,18 +191,6 @@
   bool GetHaveInstallRule() { return this->HaveInstallRule; }
   void SetHaveInstallRule(bool h) { this->HaveInstallRule = h; }
 
-  /**
-   * Get/Set the path needed for calls to install_name_tool regarding this
-   * target. Used to support fixing up installed libraries and executables on
-   * the Mac (including bundles and frameworks). Only used if the target does
-   * not have an INSTALL_NAME_DIR property.
-   * See cmInstallTargetGenerator::AddInstallNamePatchRule and callers for
-   * more information.
-   */
-  std::string GetInstallNameFixupPath() { return this->InstallNameFixupPath; }
-  void SetInstallNameFixupPath(const char *path) {
-    this->InstallNameFixupPath = path; }
-
   /** Add a utility on which this project depends. A utility is an executable
    * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
    * commands. It is not a full path nor does it have an extension.
@@ -465,7 +453,6 @@
   std::vector<std::string> LinkDirectories;
   std::set<cmStdString> LinkDirectoriesEmmitted;
   bool HaveInstallRule;
-  std::string InstallNameFixupPath;
   std::string InstallPath;
   std::string RuntimeInstallPath;
   std::string OutputDir;

Index: cmInstallTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetGenerator.cxx,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- cmInstallTargetGenerator.cxx	29 Jan 2008 20:47:18 -0000	1.55
+++ cmInstallTargetGenerator.cxx	1 Feb 2008 18:08:12 -0000	1.56
@@ -280,8 +280,6 @@
     }
   toDestDirPath += toInstallPath;
 
-  this->Target->SetInstallNameFixupPath(toInstallPath.c_str());
-
   os << indent << "IF(EXISTS \"" << toDestDirPath << "\")\n";
   this->AddInstallNamePatchRule(os, indent.Next(), config, toDestDirPath);
   this->AddChrpathPatchRule(os, indent.Next(), config, toDestDirPath);
@@ -394,23 +392,19 @@
       cmTarget* tgt = *j;
       std::string for_build = tgt->GetInstallNameDirForBuildTree(config);
       std::string for_install = tgt->GetInstallNameDirForInstallTree(config);
-      std::string fname = this->GetInstallFilename(tgt, config, false, true);
+      if(for_build != for_install)
+        {
+        // The directory portions differ.  Append the filename to
+        // create the mapping.
+        std::string fname =
+          this->GetInstallFilename(tgt, config, false, true);
 
-      // Map from the build-tree install_name.
-      for_build += fname;
+        // Map from the build-tree install_name.
+        for_build += fname;
 
-      // Map to the install-tree install_name.
-      if (!for_install.empty())
-        {
+        // Map to the install-tree install_name.
         for_install += fname;
-        }
-      else
-        {
-        for_install = tgt->GetInstallNameFixupPath();
-        }
 
-      if(for_build != for_install)
-        {
         // Store the mapping entry.
         install_name_remap[for_build] = for_install;
         }
@@ -421,26 +415,27 @@
   std::string new_id;
   if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
     {
-    std::string for_build = 
+    std::string for_build =
       this->Target->GetInstallNameDirForBuildTree(config);
-    std::string for_install = 
+    std::string for_install =
       this->Target->GetInstallNameDirForInstallTree(config);
-    std::string fname =
-      this->GetInstallFilename(this->Target, config, this->ImportLibrary,
-                               true);
-    for_build += fname;
-    if (!for_install.empty())
-      {
-      for_install += fname;
-      }
-    else
+
+    if(this->Target->IsFrameworkOnApple() && for_install.empty())
       {
-      for_install = this->Target->GetInstallNameFixupPath();
+      // Frameworks seem to have an id corresponding to their own full
+      // path.
+      // ...
+      // for_install = fullDestPath_without_DESTDIR_or_name;
       }
+
+    // If the install name will change on installation set the new id
+    // on the installed file.
     if(for_build != for_install)
       {
       // Prepare to refer to the install-tree install_name.
       new_id = for_install;
+      new_id += this->GetInstallFilename(this->Target, config,
+                                         this->ImportLibrary, true);
       }
     }
 



More information about the Cmake-commits mailing list