[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3364-g48a604c

Stephen Kelly steveire at gmail.com
Thu Jul 25 08:32:32 EDT 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  48a604ce06581cb7d530da70604e7677c73cfb46 (commit)
       via  d777b8e7167e0c1a3de4ebcf66fac5fc604f1dd9 (commit)
      from  54a2f2e64b110451e3d497aee85142e13b273e24 (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=48a604ce06581cb7d530da70604e7677c73cfb46
commit 48a604ce06581cb7d530da70604e7677c73cfb46
Merge: 54a2f2e d777b8e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 25 08:32:31 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 25 08:32:31 2013 -0400

    Merge topic 'install-interface-relative' into next
    
    d777b8e Genex: Allow relative paths in INSTALL_INTERFACE.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d777b8e7167e0c1a3de4ebcf66fac5fc604f1dd9
commit d777b8e7167e0c1a3de4ebcf66fac5fc604f1dd9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 25 09:05:03 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jul 25 14:31:22 2013 +0200

    Genex: Allow relative paths in INSTALL_INTERFACE.
    
    These paths can be prepended with the ${_IMPORT_PREFIX} generated
    in the export file.
    
    Such relative paths were previously an error.

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index cff539f..b8188a6 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -302,7 +302,8 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
   const char* sep = input ? ";" : "";
   includes += sep + tei->InterfaceIncludeDirectories;
   std::string prepro = cmGeneratorExpression::Preprocess(includes,
-                                                          preprocessRule);
+                                                         preprocessRule,
+                                                         true);
   if (!prepro.empty())
     {
     this->ResolveTargetsInGeneratorExpressions(prepro, target,
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index ab8bd13..e962313 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -229,8 +229,27 @@ static std::string stripAllGeneratorExpressions(const std::string &input)
 }
 
 //----------------------------------------------------------------------------
+static void prefixItems(const std::string &content, std::string &result,
+                        const std::string &prefix)
+{
+  std::vector<std::string> entries;
+  cmGeneratorExpression::Split(content, entries);
+  for(std::vector<std::string>::const_iterator ei = entries.begin();
+      ei != entries.end(); ++ei)
+    {
+    if (!cmSystemTools::FileIsFullPath(ei->c_str())
+        && cmGeneratorExpression::Find(*ei) == std::string::npos)
+      {
+      result += prefix;
+      }
+    result += *ei;
+    }
+}
+
+//----------------------------------------------------------------------------
 static std::string stripExportInterface(const std::string &input,
-                          cmGeneratorExpression::PreprocessContext context)
+                          cmGeneratorExpression::PreprocessContext context,
+                          bool resolveRelative)
 {
   std::string result;
 
@@ -289,7 +308,15 @@ static std::string stripExportInterface(const std::string &input,
         else if(context == cmGeneratorExpression::InstallInterface
             && gotInstallInterface)
           {
-          result += input.substr(pos, c - cStart);
+          const std::string content = input.substr(pos, c - cStart);
+          if (resolveRelative)
+            {
+            prefixItems(content, result, "${_IMPORT_PREFIX}/");
+            }
+          else
+            {
+            result += content;
+            }
           }
         break;
         }
@@ -380,7 +407,8 @@ void cmGeneratorExpression::Split(const std::string &input,
 
 //----------------------------------------------------------------------------
 std::string cmGeneratorExpression::Preprocess(const std::string &input,
-                                              PreprocessContext context)
+                                              PreprocessContext context,
+                                              bool resolveRelative)
 {
   if (context == StripAllGeneratorExpressions)
     {
@@ -388,7 +416,7 @@ std::string cmGeneratorExpression::Preprocess(const std::string &input,
     }
   else if (context == BuildInterface || context == InstallInterface)
     {
-    return stripExportInterface(input, context);
+    return stripExportInterface(input, context, resolveRelative);
     }
 
   assert(!"cmGeneratorExpression::Preprocess called with invalid args");
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 86b6f25..c20f130 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -57,7 +57,8 @@ public:
   };
 
   static std::string Preprocess(const std::string &input,
-                                PreprocessContext context);
+                                PreprocessContext context,
+                                bool resolveRelative = false);
 
   static void Split(const std::string &input,
                     std::vector<std::string> &output);
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 737ec43..8772555 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -140,6 +140,12 @@ install(FILES
 )
 add_include_lib(testLibIncludeRequired6)
 
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h" "// No content\n")
+install(FILES
+  "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h"
+    DESTINATION include/testLibIncludeRequired7
+)
+
 set_property(TARGET testLibRequired APPEND PROPERTY
   INTERFACE_INCLUDE_DIRECTORIES
     $<TARGET_PROPERTY:testLibIncludeRequired1,INTERFACE_INCLUDE_DIRECTORIES>
@@ -154,6 +160,7 @@ set_property(TARGET testLibRequired APPEND PROPERTY
     $<BUILD_INTERFACE:$<TARGET_PROPERTY:testLibIncludeRequired5,INTERFACE_INCLUDE_DIRECTORIES>>
     # Test that the below is non-fatal
     $<$<STREQUAL:one,two>:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES>>
+    $<INSTALL_INTERFACE:include/testLibIncludeRequired7>
 )
 
 set_property(TARGET testLibRequired APPEND PROPERTY
diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c
index d9dc331..48a4c44 100644
--- a/Tests/ExportImport/Import/A/deps_iface.c
+++ b/Tests/ExportImport/Import/A/deps_iface.c
@@ -2,6 +2,7 @@
 #include "testLibIncludeRequired1.h"
 #include "testLibIncludeRequired2.h"
 #include "testLibIncludeRequired6.h"
+#include "testLibIncludeRequired7.h"
 
 #include "installIncludesTest.h"
 #include "installIncludesTest2.h"

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

Summary of changes:
 Source/cmExportFileGenerator.cxx         |    3 +-
 Source/cmGeneratorExpression.cxx         |   36 ++++++++++++++++++++++++++---
 Source/cmGeneratorExpression.h           |    3 +-
 Tests/ExportImport/Export/CMakeLists.txt |    7 +++++
 Tests/ExportImport/Import/A/deps_iface.c |    1 +
 5 files changed, 44 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list