[Cmake-commits] CMake branch, next, updated. v3.0.2-5687-g72153e9

Brad King brad.king at kitware.com
Wed Oct 8 11:15:53 EDT 2014


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  72153e9ab836239896d69fa229824d512c3568f4 (commit)
       via  a6e58f5538c23f3af3bc80d5df27a52e620245ef (commit)
      from  8f504138adb4a1a214d7e5d758dfbb67625ae8f6 (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=72153e9ab836239896d69fa229824d512c3568f4
commit 72153e9ab836239896d69fa229824d512c3568f4
Merge: 8f50413 a6e58f5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 8 11:15:53 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 8 11:15:53 2014 -0400

    Merge topic 'rpath-osx-10_6' into next
    
    a6e58f55 OSX: Warn when attempting to change runtime paths on OS X 10.5


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6e58f5538c23f3af3bc80d5df27a52e620245ef
commit a6e58f5538c23f3af3bc80d5df27a52e620245ef
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Mon Oct 6 22:24:10 2014 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Oct 8 11:15:14 2014 -0400

    OSX: Warn when attempting to change runtime paths on OS X 10.5
    
    Even though 10.5 supports @rpath, the support is not complete
    enough for CMake.  For instance, install_name_tool doesn't support
    adding and removing rpaths.
    
    Also modifying BundleUtilities test to remove an undesirable cmake
    generated runtime path.  The intent was to build with the install
    rpath as is done with the other cases in this test.

diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 8a1c53e..1cb5b0f 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -688,35 +688,58 @@ cmInstallTargetGenerator
     cli->GetRPath(oldRuntimeDirs, false);
     cli->GetRPath(newRuntimeDirs, true);
 
-    // 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)
+    std::string darwin_major_version_s =
+      this->Target->GetMakefile()->GetSafeDefinition("DARWIN_MAJOR_VERSION");
+
+    std::stringstream ss(darwin_major_version_s);
+    int darwin_major_version;
+    ss >> darwin_major_version;
+    if(!ss.fail() && darwin_major_version <= 9 &&
+       (!oldRuntimeDirs.empty() || !newRuntimeDirs.empty())
+      )
       {
-      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";
-        }
+      cmOStringStream msg;
+      msg << "WARNING: Target \"" << this->Target->GetName()
+        << "\" has runtime paths which cannot be changed during install.  "
+        << "To change runtime paths, OS X version 10.6 or newer is required.  "
+        << "Therefore, runtime paths will not be changed when installing.";
+      cmSystemTools::Message(msg.str().c_str(), "Warning");
       }
-
-    runpaths.clear();
-    for(std::vector<std::string>::const_iterator i = newRuntimeDirs.begin();
-        i != newRuntimeDirs.end(); ++i)
+    else
       {
-      std::string runpath = this->Target->GetMakefile()->GetLocalGenerator()->
-        GetGlobalGenerator()->ExpandCFGIntDir(*i, config);
+      // 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)
+        {
+        std::string runpath =
+          this->Target->GetMakefile()->GetLocalGenerator()->
+          GetGlobalGenerator()->ExpandCFGIntDir(*i, config);
 
-      if(runpaths.find(runpath) == runpaths.end())
+        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 \"" << runpath << "\"\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";
+          }
         }
       }
     }
diff --git a/Tests/BundleUtilities/CMakeLists.txt b/Tests/BundleUtilities/CMakeLists.txt
index 3a1cf55..69ef535 100644
--- a/Tests/BundleUtilities/CMakeLists.txt
+++ b/Tests/BundleUtilities/CMakeLists.txt
@@ -109,7 +109,8 @@ if(APPLE AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 9.0)
   target_link_libraries(testbundleutils3 shared-3 framework-3 ${CMAKE_DL_LIBS})
 
   set_target_properties(testbundleutils3 module3 PROPERTIES
-                        LINK_FLAGS "-Wl,-rpath, at loader_path/")
+                        LINK_FLAGS "-Wl,-rpath, at loader_path/"
+                        BUILD_WITH_INSTALL_RPATH 1)
 
   # add custom target to install and test the app
   add_custom_target(testbundleutils3_test  ALL

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list