This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  19486e0d4b4b8eb7ff82317c0ffda20be700a250 (commit)
       via  08141a56818220e4712773df667ff8aa57f7958d (commit)
       via  6385c7151631a4ac72490540fe75cb0b9ebbedf5 (commit)
      from  97384edded346b7b5e92c87780e8635b71ff0549 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19486e0d4b4b8eb7ff82317c0ffda20be700a250
commit 19486e0d4b4b8eb7ff82317c0ffda20be700a250
Merge: 97384ed 08141a5
Author:     Clinton Stimpson <clin...@elemtech.com>
AuthorDate: Sat Feb 1 23:23:09 2014 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Sat Feb 1 23:23:09 2014 -0500

    Merge topic 'osx-rpath-unique' into next
    
    08141a56 OS X: Make sure RPATHs are unique to avoid possible corruption.
    6385c715 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08141a56818220e4712773df667ff8aa57f7958d
commit 08141a56818220e4712773df667ff8aa57f7958d
Author:     Clinton Stimpson <clin...@elemtech.com>
AuthorDate: Sat Feb 1 21:18:04 2014 -0700
Commit:     Clinton Stimpson <clin...@elemtech.com>
CommitDate: Sat Feb 1 21:18:04 2014 -0700

    OS X: Make sure RPATHs are unique to avoid possible corruption.
    
    When using link_directories() and including CMAKE_CFG_INTDIR,
    one can end up with duplicate RPATHs in the binary which
    install_name_tool cannot fix without corrupting the binary.
    Also, the cmake_install.cmake file has been fixed to correctly
    handle these generator specific variables.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 03486d8..a61cab1 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -3032,3 +3032,10 @@ void cmGlobalGenerator::ProcessEvaluationFiles()
       }
     }
 }
+
+//----------------------------------------------------------------------------
+std::string cmGlobalGenerator::ExpandCFGIntDir(const std::string& str,
+                            const std::string& /*config*/) const
+{
+  return str;
+}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ebc2db5..753eebf 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -193,6 +193,10 @@ public:
   ///! What is the configurations directory variable called?
   virtual const char* GetCMakeCFGIntDir() const { return "."; }
 
+  ///! expand CFGIntDir for a configuration
+  virtual std::string ExpandCFGIntDir(const std::string& str,
+                                      const std::string& config) const;
+
   /** Get whether the generator should use a script for link commands.  */
   bool GetUseLinkScript() const { return this->UseLinkScript; }
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx 
b/Source/cmGlobalVisualStudioGenerator.cxx
index 42492e6..556ef05 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -902,3 +902,20 @@ cmGlobalVisualStudioGenerator::OrderedTargetDependSet
     this->insert(*ti);
     }
 }
+
+std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir(
+  const std::string& str,
+  const std::string& config) const
+{
+  std::string replace = GetCMakeCFGIntDir();
+
+  std::string tmp = str;
+  for(std::string::size_type i = tmp.find(replace);
+      i != std::string::npos;
+      i = tmp.find(replace, i))
+    {
+    tmp.replace(i, replace.size(), config);
+    i += (config.size() - replace.size());
+    }
+  return tmp;
+}
diff --git a/Source/cmGlobalVisualStudioGenerator.h 
b/Source/cmGlobalVisualStudioGenerator.h
index eab613d..9186d65 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -84,6 +84,10 @@ public:
 
   virtual void FindMakeProgram(cmMakefile*);
 
+
+  virtual std::string ExpandCFGIntDir(const std::string& str,
+                                      const std::string& config) const;
+
 protected:
   // Does this VS version link targets to each other if there are
   // dependencies in the SLN file?  This was done for VS versions
diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index 46c34d0..067de38 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2272,14 +2272,24 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     std::string search_paths;
     std::vector<std::string> runtimeDirs;
     pcli->GetRPath(runtimeDirs, false);
+    // runpath dirs needs to be unique to prevent corruption
+    std::set<std::string> unique_dirs;
+
     for(std::vector<std::string>::const_iterator i = runtimeDirs.begin();
         i != runtimeDirs.end(); ++i)
       {
-      if(!search_paths.empty())
+      std::string runpath = *i;
+      runpath = this->ExpandCFGIntDir(runpath, configName);
+
+      if(unique_dirs.find(runpath) == unique_dirs.end())
         {
-        search_paths += " ";
+        unique_dirs.insert(runpath);
+        if(!search_paths.empty())
+          {
+          search_paths += " ";
+          }
+        search_paths += this->XCodeEscapePath(runpath.c_str());
         }
-      search_paths += this->XCodeEscapePath((*i).c_str());
       }
     if(!search_paths.empty())
       {
@@ -3675,6 +3685,30 @@ const char* cmGlobalXCodeGenerator::GetCMakeCFGIntDir() 
const
     "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" : ".";
 }
 
+std::string cmGlobalXCodeGenerator::ExpandCFGIntDir(const std::string& str,
+                                        const std::string& config) const
+{
+  std::string replace1 = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+  std::string replace2 = "$(CONFIGURATION)";
+
+  std::string tmp = str;
+  for(std::string::size_type i = tmp.find(replace1);
+      i != std::string::npos;
+      i = tmp.find(replace1, i))
+    {
+    tmp.replace(i, replace1.size(), config);
+    i += (config.size() - replace1.size());
+    }
+  for(std::string::size_type i = tmp.find(replace2);
+      i != std::string::npos;
+      i = tmp.find(replace2, i))
+    {
+    tmp.replace(i, replace2.size(), config);
+    i += (config.size() - replace2.size());
+    }
+  return tmp;
+}
+
 //----------------------------------------------------------------------------
 void cmGlobalXCodeGenerator::GetDocumentation(cmDocumentationEntry& entry)
 {
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index ae7f07e..c9d20c2 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -79,6 +79,9 @@ public:
 
   ///! What is the configurations directory variable called?
   virtual const char* GetCMakeCFGIntDir() const;
+  ///! expand CFGIntDir
+  virtual std::string ExpandCFGIntDir(const std::string& str,
+                                      const std::string& config) const;
 
   void SetCurrentLocalGenerator(cmLocalGenerator*);
 
diff --git a/Source/cmInstallTargetGenerator.cxx 
b/Source/cmInstallTargetGenerator.cxx
index 68f45a6..7a39f45 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -669,22 +669,36 @@ cmInstallTargetGenerator
     cli->GetRPath(oldRuntimeDirs, false);
     cli->GetRPath(newRuntimeDirs, true);
 
-    // Note: These are separate commands to avoid install_name_tool
-    // corruption on 10.6.
+    // Note: These paths are kept unique to avoid install_name_tool corruption.
+    std::set<std::string> runpaths;
     for(std::vector<std::string>::const_iterator i = oldRuntimeDirs.begin();
         i != oldRuntimeDirs.end(); ++i)
       {
-      os << indent << "execute_process(COMMAND " << installNameTool << "\n";
-      os << indent << "  -delete_rpath \"" << *i << "\"\n";
-      os << indent << "  \"" << toDestDirPath << "\")\n";
+      std::string runpath = this->Target->GetMakefile()->GetLocalGenerator()->
+        GetGlobalGenerator()->ExpandCFGIntDir(*i, config);
+
+      if(runpaths.find(runpath) == runpaths.end())
+        {
+        runpaths.insert(runpath);
+        os << indent << "execute_process(COMMAND " << installNameTool << "\n";
+        os << indent << "  -delete_rpath \"" << runpath << "\"\n";
+        os << indent << "  \"" << toDestDirPath << "\")\n";
+        }
       }
 
+    runpaths.clear();
     for(std::vector<std::string>::const_iterator i = newRuntimeDirs.begin();
         i != newRuntimeDirs.end(); ++i)
       {
-      os << indent << "execute_process(COMMAND " << installNameTool << "\n";
-      os << indent << "  -add_rpath \"" << *i << "\"\n";
-      os << indent << "  \"" << toDestDirPath << "\")\n";
+      std::string runpath = this->Target->GetMakefile()->GetLocalGenerator()->
+        GetGlobalGenerator()->ExpandCFGIntDir(*i, config);
+
+      if(runpaths.find(runpath) == runpaths.end())
+        {
+        os << indent << "execute_process(COMMAND " << installNameTool << "\n";
+        os << indent << "  -add_rpath \"" << runpath << "\"\n";
+        os << indent << "  \"" << toDestDirPath << "\")\n";
+        }
       }
     }
   else

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake                |    2 +-
 Source/cmGlobalGenerator.cxx             |    7 ++++++
 Source/cmGlobalGenerator.h               |    4 +++
 Source/cmGlobalVisualStudioGenerator.cxx |   17 +++++++++++++
 Source/cmGlobalVisualStudioGenerator.h   |    4 +++
 Source/cmGlobalXCodeGenerator.cxx        |   40 +++++++++++++++++++++++++++---
 Source/cmGlobalXCodeGenerator.h          |    3 +++
 Source/cmInstallTargetGenerator.cxx      |   30 ++++++++++++++++------
 8 files changed, 95 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to