[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3127-ge96cef5

Stephen Kelly steveire at gmail.com
Mon Jul 15 11:12:15 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  e96cef5a31437a20127da80715bcfd1fdf8911e0 (commit)
       via  537ab88be837f33903663afcbe9da33f13c727a1 (commit)
      from  273e4f86f2ea2f73ede7d5d775df8196a9e9207b (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=e96cef5a31437a20127da80715bcfd1fdf8911e0
commit e96cef5a31437a20127da80715bcfd1fdf8911e0
Merge: 273e4f8 537ab88
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 15 11:12:12 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 15 11:12:12 2013 -0400

    Merge topic 'install-interface-includes' into next
    
    537ab88 Add a convenient way to add the includes install dir to the INTERFACE.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=537ab88be837f33903663afcbe9da33f13c727a1
commit 537ab88be837f33903663afcbe9da33f13c727a1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 5 12:13:49 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 15 17:11:47 2013 +0200

    Add a convenient way to add the includes install dir to the INTERFACE.

diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index dcd418b..376b6f1 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -219,6 +219,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
   cmCAStringVector runtimeArgVector      (&argHelper,"RUNTIME",&group);
   cmCAStringVector frameworkArgVector    (&argHelper,"FRAMEWORK",&group);
   cmCAStringVector bundleArgVector       (&argHelper,"BUNDLE",&group);
+  cmCAStringVector includesArgVector     (&argHelper,"INCLUDES",&group);
   cmCAStringVector privateHeaderArgVector(&argHelper,"PRIVATE_HEADER",&group);
   cmCAStringVector publicHeaderArgVector (&argHelper,"PUBLIC_HEADER",&group);
   cmCAStringVector resourceArgVector     (&argHelper,"RESOURCE",&group);
@@ -247,6 +248,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
   cmInstallCommandArguments privateHeaderArgs(this->DefaultComponentName);
   cmInstallCommandArguments publicHeaderArgs(this->DefaultComponentName);
   cmInstallCommandArguments resourceArgs(this->DefaultComponentName);
+  cmInstallCommandIncludesArgument includesArgs;
 
   // now parse the args for specific parts of the target (e.g. LIBRARY,
   // RUNTIME, ARCHIVE etc.
@@ -258,6 +260,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
   privateHeaderArgs.Parse(&privateHeaderArgVector.GetVector(), &unknownArgs);
   publicHeaderArgs.Parse (&publicHeaderArgVector.GetVector(),  &unknownArgs);
   resourceArgs.Parse     (&resourceArgVector.GetVector(),      &unknownArgs);
+  includesArgs.Parse     (&includesArgVector.GetVector(),      &unknownArgs);
 
   if(!unknownArgs.empty())
     {
@@ -383,6 +386,21 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
         this->SetError(e.str().c_str());
         return false;
         }
+      std::vector<std::string> dirs = includesArgs.GetIncludeDirs();
+      if(!dirs.empty())
+        {
+        std::string dirString;
+        const char *sep = "";
+        for (std::vector<std::string>::const_iterator it = dirs.begin();
+            it != dirs.end(); ++it)
+          {
+          dirString += sep;
+          dirString += *it;
+          sep = ";";
+          }
+        target->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES",
+          ("$<INSTALL_INTERFACE:" + dirString + ">").c_str());
+        }
       // Store the target in the list to be installed.
       targets.push_back(target);
       }
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 7c06009..cb937dd 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -102,6 +102,7 @@ public:
       "          [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|\n"
       "            PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]\n"
       "           [DESTINATION <dir>]\n"
+      "           [INCLUDES DESTINATION [<dir> ...]]\n"
       "           [PERMISSIONS permissions...]\n"
       "           [CONFIGURATIONS [Debug|Release|...]]\n"
       "           [COMPONENT <component>]\n"
@@ -130,6 +131,10 @@ public:
       "all target types.  If only one is given then only targets of that "
       "type will be installed (which can be used to install just a DLL or "
       "just an import library)."
+      "The INCLUDES DESTINATION specifies a list of directories which will "
+      "be added to the INTERFACE_INCLUDE_DIRECTORIES of the <targets> when "
+      "exported by install(EXPORT).  If a relative path is specified, it is "
+      "treated as relative to the $<INSTALL_PREFIX>."
       "\n"
       "The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause "
       "subsequent properties to be applied to installing a FRAMEWORK "
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 8e48f08..91ea861 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -203,3 +203,37 @@ bool cmInstallCommandArguments::CheckPermissions(
   // This is not a valid permission.
   return false;
 }
+
+cmInstallCommandIncludesArgument::cmInstallCommandIncludesArgument()
+{
+
+}
+
+const std::vector<std::string>&
+cmInstallCommandIncludesArgument::GetIncludeDirs() const
+{
+  return this->IncludeDirs;
+}
+
+void cmInstallCommandIncludesArgument::Parse(
+                                        const std::vector<std::string>* args,
+                                        std::vector<std::string>*)
+{
+  if(args->empty())
+    {
+    return;
+    }
+  std::vector<std::string>::const_iterator it = args->begin();
+  ++it;
+  for ( ; it != args->end(); ++it)
+    {
+    std::string dir = *it;
+    if (!cmSystemTools::FileIsFullPath(it->c_str())
+        && cmGeneratorExpression::Find(*it) == std::string::npos)
+      {
+      dir = "$<INSTALL_PREFIX>/" + dir;
+      }
+    cmSystemTools::ConvertToUnixSlashes(dir);
+    this->IncludeDirs.push_back(dir);
+    }
+}
diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h
index 01f7d56..90347e6 100644
--- a/Source/cmInstallCommandArguments.h
+++ b/Source/cmInstallCommandArguments.h
@@ -65,4 +65,17 @@ class cmInstallCommandArguments
     bool CheckPermissions();
 };
 
+class cmInstallCommandIncludesArgument
+{
+  public:
+    cmInstallCommandIncludesArgument();
+    void Parse(const std::vector<std::string>* args,
+               std::vector<std::string>* unconsumedArgs);
+
+    const std::vector<std::string>& GetIncludeDirs() const;
+
+  private:
+    std::vector<std::string> IncludeDirs;
+};
+
 #endif
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index efecd03..dd60b47 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -240,9 +240,26 @@ install(TARGETS testLibRequired
                 testLibIncludeRequired5
                 testLibIncludeRequired6
                 testSharedLibRequired
-        EXPORT RequiredExp DESTINATION lib )
+        EXPORT RequiredExp DESTINATION lib
+        INCLUDES DESTINATION
+          installIncludesTest
+          $<INSTALL_PREFIX>/installIncludesTest2)
 install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredTargets.cmake DESTINATION lib/cmake/testLibRequired)
 
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" "// No content\n")
+
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h" "// No content\n")
+install(FILES
+  "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h"
+  DESTINATION installIncludesTest
+)
+install(FILES
+  "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h"
+  DESTINATION installIncludesTest2
+)
+
 install(TARGETS testLibDepends testSharedLibDepends EXPORT DependsExp DESTINATION lib )
 install(EXPORT DependsExp FILE testLibDependsTargets.cmake DESTINATION lib/cmake/testLibDepends)
 
diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c
index e73ca26..d9dc331 100644
--- a/Tests/ExportImport/Import/A/deps_iface.c
+++ b/Tests/ExportImport/Import/A/deps_iface.c
@@ -3,6 +3,9 @@
 #include "testLibIncludeRequired2.h"
 #include "testLibIncludeRequired6.h"
 
+#include "installIncludesTest.h"
+#include "installIncludesTest2.h"
+
 #ifndef testLibRequired_IFACE_DEFINE
 #error Expected testLibRequired_IFACE_DEFINE
 #endif

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list