[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5313-gb951072

Stephen Kelly steveire at gmail.com
Mon Nov 18 13:22:59 EST 2013


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  b951072536de313ccc716bec889e0a868a3ff8f4 (commit)
       via  c863afe63b2b6bfc1f9fe231c8a82d8c5966fb11 (commit)
      from  9b8ca0ec552bed2d644c4e7440ac90ecf2034f27 (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=b951072536de313ccc716bec889e0a868a3ff8f4
commit b951072536de313ccc716bec889e0a868a3ff8f4
Merge: 9b8ca0e c863afe
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 18 13:22:54 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 18 13:22:54 2013 -0500

    Merge topic 'cross-compiling-toolchain-variables' into next
    
    c863afe Introduce CMAKE_STAGING_PREFIX variable.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c863afe63b2b6bfc1f9fe231c8a82d8c5966fb11
commit c863afe63b2b6bfc1f9fe231c8a82d8c5966fb11
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Nov 14 12:04:40 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 18 19:22:44 2013 +0100

    Introduce CMAKE_STAGING_PREFIX variable.
    
    This variable can be useful in cross-compiling contexts where the
    sysroot is read-only or where the sysroot should otherwise remain
    pristine.
    
    If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
    of CMAKE_INSTALL_PREFIX when generating the installation rules in
    cmake_install.cmake.
    
    This way, the CMAKE_INSTALL_PREFIX variable
    always refers to the installation prefix on the target device, regardless
    of whether host==target.
    
    If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
    the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
    Matching paths in the -rpath-link are not transformed.
    
    The cross-prefix usr-move workaround is assumed not to require extension
    regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
    there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
    is still used to determine the workaround path, and that variable
    remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
    generated export files are deployed to the target, the workaround
    will still be in place, and still be employed if required.

diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index 5889e90..a3eca95 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -94,6 +94,8 @@ If NO_DEFAULT_PATH is not specified, the search process is as follows:
    or in the short-hand version of the command.
    These are typically hard-coded guesses.
 
+7. Search the path specified by the :variable:`CMAKE_STAGING_PREFIX` variable.
+
 .. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
 
 .. include:: FIND_XXX_MAC.txt
diff --git a/Help/command/FIND_XXX_ROOT.txt b/Help/command/FIND_XXX_ROOT.txt
index 7f80dcb..61519d1 100644
--- a/Help/command/FIND_XXX_ROOT.txt
+++ b/Help/command/FIND_XXX_ROOT.txt
@@ -1,7 +1,9 @@
 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
 directories to be prepended to all other search directories.  This
-effectively "re-roots" the entire search under given locations.  By
-default it is empty.
+effectively "re-roots" the entire search under given locations.
+The :variable:`CMAKE_STAGING_PREFIX` is excluded from this re-rooting, because
+it is always a path on the host system. By default the CMAKE_FIND_ROOT_PATH
+is empty.
 
 The :variable:`CMAKE_SYSROOT` variable can also be used to specify exactly one
 directory to use as a prefix.  Setting :variable:`CMAKE_SYSROOT` also has other
@@ -12,10 +14,11 @@ point to the root directory of the target environment and CMake will
 search there too.  By default at first the directories listed in
 CMAKE_FIND_ROOT_PATH are searched, then the :variable:`CMAKE_SYSROOT` directory is
 searched, and then the non-rooted directories will be
-searched.  The default behavior can be adjusted by setting
+searched, and finally the :variable:`CMAKE_STAGING_PREFIX` will be searched.
+The default behavior can be adjusted by setting
 |CMAKE_FIND_ROOT_PATH_MODE_XXX|.  This behavior can be manually
 overridden on a per-call basis.  By using CMAKE_FIND_ROOT_PATH_BOTH
 the search order will be as described above.  If
 NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be
 used.  If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted
-directories will be searched.
+directories and the :variable:`CMAKE_STAGING_PREFIX` will be searched.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index dd82b40..a46539f 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -110,6 +110,7 @@ Variables that Change Behavior
    /variable/CMAKE_PREFIX_PATH
    /variable/CMAKE_PROGRAM_PATH
    /variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
+   /variable/CMAKE_STAGING_PREFIX
    /variable/CMAKE_SYSTEM_IGNORE_PATH
    /variable/CMAKE_SYSTEM_INCLUDE_PATH
    /variable/CMAKE_SYSTEM_LIBRARY_PATH
diff --git a/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst b/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
index 91231b0..70d920b 100644
--- a/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
+++ b/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
@@ -3,11 +3,13 @@ CMAKE_FIND_NO_INSTALL_PREFIX
 
 Ignore the :variable:`CMAKE_INSTALL_PREFIX` when searching for assets.
 
-CMake adds the :variable:`CMAKE_INSTALL_PREFIX` to the
+CMake adds the :variable:`CMAKE_INSTALL_PREFIX` and the
+:variable:`CMAKE_STAGING_PREFIX` variable to the
 :variable:`CMAKE_SYSTEM_PREFIX_PATH` by default. This variable may be set
 on the command line to control that behavior.
 
 Set :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` to TRUE to tell find_package not
-to search in the :variable:`CMAKE_INSTALL_PREFIX` by default.  Note that the
+to search in the :variable:`CMAKE_INSTALL_PREFIX` or
+:variable:`CMAKE_STAGING_PREFIX` by default.  Note that the
 prefix may still be searched for other reasons, such as being the same prefix
 as the CMake installation, or for being a built-in system prefix.
diff --git a/Help/variable/CMAKE_STAGING_PREFIX.rst b/Help/variable/CMAKE_STAGING_PREFIX.rst
new file mode 100644
index 0000000..c4de7da
--- /dev/null
+++ b/Help/variable/CMAKE_STAGING_PREFIX.rst
@@ -0,0 +1,13 @@
+CMAKE_STAGING_PREFIX
+--------------------
+
+This variable may be set to a path to install to when cross-compiling. This can
+be useful if the path in :variable:`CMAKE_SYSROOT` is read-only, or otherwise
+should remain pristine.
+
+The CMAKE_STAGING_PREFIX location is also used as a search prefix by the ``find_*``
+commands. This can be controlled by setting the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX`
+variable.
+
+If any RPATH/RUNPATH entries passed to the linker contain the CMAKE_STAGING_PREFIX,
+the matching path fragments are replaced with the :variable:`CMAKE_INSTALL_PREFIX`.
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 3152c2a..0ef3d2e 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1902,6 +1902,10 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
   if(use_build_rpath || use_link_rpath)
     {
     std::string rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
+    const char *stagePath
+                  = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
+    const char *installPrefix
+                  = this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
     cmSystemTools::ConvertToUnixSlashes(rootPath);
     std::vector<std::string> const& rdirs = this->GetRuntimeSearchPath();
     for(std::vector<std::string>::const_iterator ri = rdirs.begin();
@@ -1916,6 +1920,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
           {
           d = d.substr(rootPath.size());
           }
+        else if (stagePath && *stagePath && d.find(stagePath) == 0)
+          {
+          std::string suffix = d.substr(strlen(stagePath));
+          d = installPrefix;
+          d += "/";
+          d += suffix;
+          cmSystemTools::ConvertToUnixSlashes(d);
+          }
         if(emitted.insert(d).second)
           {
           runtimeDirs.push_back(d);
@@ -1936,6 +1948,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
             {
             d = d.substr(rootPath.size());
             }
+          else if (stagePath && *stagePath && d.find(stagePath) == 0)
+            {
+            std::string suffix = d.substr(strlen(stagePath));
+            d = installPrefix;
+            d += "/";
+            d += suffix;
+            cmSystemTools::ConvertToUnixSlashes(d);
+            }
           if(emitted.insert(d).second)
             {
             runtimeDirs.push_back(d);
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 8c42811..c4663ef 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -440,6 +440,18 @@ void cmFindCommon::ComputeFinalPaths()
   // Expand list of paths inside all search roots.
   this->RerootPaths(paths);
 
+  // Process the CMAKE_STAGING_PREFIX after re-rooting the paths.
+  // The CMAKE_STAGING_PREFIX is always a host path, so it should never
+  // be re-rooted onto the CMAKE_SYSROOT or the CMAKE_FIND_ROOT_PATH entries.
+  if(const char* stagePrefix =
+      this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX"))
+    {
+    if (!this->Makefile->IsOn("CMAKE_FIND_NO_INSTALL_PREFIX"))
+      {
+      paths.push_back(stagePrefix);
+      }
+    }
+
   // Add a trailing slash to all paths to aid the search process.
   for(std::vector<std::string>::iterator i = paths.begin();
       i != paths.end(); ++i)
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d2784a9..cf5798f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -370,6 +370,11 @@ void cmLocalGenerator::GenerateInstallRules()
     prefix = "/usr/local";
     }
 #endif
+  if (const char *stagingPrefix
+                  = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX"))
+    {
+    prefix = stagingPrefix;
+    }
 
   // Compute the set of configurations.
   std::vector<std::string> configurationTypes;

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list