[Cmake-commits] CMake branch, next, updated. v3.6.1-1831-ge9c23dd

Brad King brad.king at kitware.com
Wed Sep 7 08:14:46 EDT 2016


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  e9c23dd91637f50b0b4a352a86f0126365e128e0 (commit)
       via  290e4ce8a89819d6617fa404513d8a1629cafea7 (commit)
      from  343ef96f1091e7ccab80d65f6ef9a225aa6d6064 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9c23dd91637f50b0b4a352a86f0126365e128e0
commit e9c23dd91637f50b0b4a352a86f0126365e128e0
Merge: 343ef96 290e4ce
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 7 08:14:45 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Sep 7 08:14:45 2016 -0400

    Merge topic 'install-export-root-prefix' into next
    
    290e4ce8 install: Fix computed import prefix in export files when it is "/"


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=290e4ce8a89819d6617fa404513d8a1629cafea7
commit 290e4ce8a89819d6617fa404513d8a1629cafea7
Author:     Ben Keller <irods.ben.keller at gmail.com>
AuthorDate: Tue May 10 11:44:40 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 6 16:47:02 2016 -0400

    install: Fix computed import prefix in export files when it is "/"
    
    When exporting from a project (with install(EXPORT ...)), the
    `<PROJECT>Targets.cmake` file contains logic for computing the
    `_IMPORT_PREFIX` from its own location.  This `_IMPORT_PREFIX` is then
    used in the `<PROJECT>Targets-<config>.cmake` file to generate the
    `IMPORTED_LOCATION_<CONFIG>`.  The generation unconditionally appends a
    "/" to `_IMPORT_PREFIX` before appending the rest of the path.  If
    `_IMPORT_PREFIX` is "/", then the `IMPORTED_LOCATION_<CONFIG>`
    properties all start with exactly two leading slashes ("//").
    
    Exactly two leading slashes is a special case in POSIX file paths, such
    that its interpretation is left up to the implementation.  This means
    that changing the path prefix from "/" to "//" should not be allowed.
    
    Since references to `_IMPORT_PREFIX` are always followed by a "/",
    simply check the value to replace "/" with "".

diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index ceba69a..bcadaa0 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -122,7 +122,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
             "PATH)\n";
       dest = cmSystemTools::GetFilenamePath(dest);
     }
-    os << "\n";
+    os << "if(_IMPORT_PREFIX STREQUAL \"/\")\n"
+       << "  set(_IMPORT_PREFIX \"\")\n"
+       << "endif()\n"
+       << "\n";
   }
 
   std::vector<std::string> missingTargets;

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

Summary of changes:
 Source/cmExportInstallFileGenerator.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list