[Cmake-commits] CMake branch, next, updated. v2.8.9-1182-g88d77e7

Brad King brad.king at kitware.com
Mon Oct 22 14:09:52 EDT 2012


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  88d77e7f29a71f9c583419f184508c5fff822960 (commit)
       via  e386992152ac3ba5fe2abb66a56ea6ae99d6e8f3 (commit)
       via  95d590ddbac80780f437252de4522b78f4069f45 (commit)
       via  04421042b3eb5977208929ba01faf7816c2f8f69 (commit)
      from  4aaeb805fa8261a9edfbe12f3de562e918a35d8c (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=88d77e7f29a71f9c583419f184508c5fff822960
commit 88d77e7f29a71f9c583419f184508c5fff822960
Merge: 4aaeb80 e386992
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 22 14:09:50 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 22 14:09:50 2012 -0400

    Merge topic 'genex-validate-target-property-names' into next
    
    e386992 GexEx: Validate Target names and property names differently.
    95d590d GenEx: Create cmGeneratorTargets for imported targets.
    0442104 GenEx: Add an accessor for imported targets in a makefile.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e386992152ac3ba5fe2abb66a56ea6ae99d6e8f3
commit e386992152ac3ba5fe2abb66a56ea6ae99d6e8f3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 19 13:11:59 2012 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 22 14:05:48 2012 -0400

    GexEx: Validate Target names and property names differently.
    
    In the unit test, use the same IMPORTED_LOCATION trick that
    the ExportImport test uses.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 287066a..ee1b60a 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -277,8 +277,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
           "$<TARGET_PROPERTY:...> expression requires one or two parameters");
       return std::string();
       }
-    cmsys::RegularExpression nameValidator;
-    nameValidator.compile("^[A-Za-z0-9_.-]+$");
+    cmsys::RegularExpression targetNameValidator;
+    // The ':' is supported to allow use with IMPORTED targets. At least
+    // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter.
+    targetNameValidator.compile("^[A-Za-z0-9_.:-]+$");
+    cmsys::RegularExpression propertyNameValidator;
+    propertyNameValidator.compile("^[A-Za-z0-9_]+$");
 
     cmGeneratorTarget* target = context->Target;
     std::string propertyName = *parameters.begin();
@@ -301,9 +305,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 
       std::string targetName = parameters.front();
       propertyName = parameters[1];
-      if (!nameValidator.find(targetName.c_str()))
+      if (!targetNameValidator.find(targetName.c_str()))
         {
-        if (!nameValidator.find(propertyName.c_str()))
+        if (!propertyNameValidator.find(propertyName.c_str()))
           {
           ::reportError(context, content->GetOriginalExpression(),
                         "Target name and property name not supported.");
@@ -335,7 +339,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
       return std::string();
       }
 
-    if (!nameValidator.find(propertyName.c_str()))
+    if (!propertyNameValidator.find(propertyName.c_str()))
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "Property name not supported.");
@@ -480,7 +484,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
     std::string name = *parameters.begin();
 
     cmsys::RegularExpression targetValidator;
-    targetValidator.compile("^[A-Za-z0-9_.-]+$");
+    // The ':' is supported to allow use with IMPORTED targets.
+    targetValidator.compile("^[A-Za-z0-9_.:-]+$");
     if (!targetValidator.find(name.c_str()))
       {
       ::reportError(context, content->GetOriginalExpression(),
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index d71f92e..7cb1b42 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -17,6 +17,7 @@ create_header(bing)
 create_header(bung)
 create_header(arguments)
 create_header(list)
+create_header(target)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
@@ -24,6 +25,7 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar")
 include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bang>")
 
 add_executable(TargetIncludeDirectories main.cpp)
+
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY
@@ -34,3 +36,12 @@ include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bung>")
 include_directories("sing$<1:/ting>")
 
 include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/arguments;${CMAKE_CURRENT_BINARY_DIR}/list>")
+
+add_library(somelib::withcolons UNKNOWN IMPORTED)
+set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target")
+set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target")
+
+set_property(TARGET TargetIncludeDirectories
+  APPEND PROPERTY INCLUDE_DIRECTORIES
+  "$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>"
+)
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
index 030bb1c..90909d3 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
@@ -9,6 +9,7 @@
 #include "ting.h"
 #include "arguments.h"
 #include "list.h"
+#include "target.h"
 
 int main(int, char**)
 {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95d590ddbac80780f437252de4522b78f4069f45
commit 95d590ddbac80780f437252de4522b78f4069f45
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 10 00:07:34 2012 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 22 14:03:51 2012 -0400

    GenEx: Create cmGeneratorTargets for imported targets.
    
    We're going to need to link to them, and all the linking API is moving
    to cmGeneratorTarget.
    
    Skip imported targets when iterating over cmGeneratorTargets in places
    where we only want targets we build.  The GetGeneratorTargets result now
    includes IMPORTED targets where it didn't before.  The GetTargets
    result, which was what used to be called in these methods does not
    include IMPORTED targets.  This doesn't relate to any known bugs, but in
    some future uses of GetGeneratorTargets it will be important, so
    starting the convention and being deliberate now is a good idea.

diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 689f213..96b8a09 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -889,6 +889,10 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
     for (cmGeneratorTargetsType::iterator l = targets.begin();
          l != targets.end(); ++l)
       {
+      if (l->first->IsImported())
+        {
+        continue;
+        }
       std::vector<std::string> includeDirs;
       const char *config = mf->GetDefinition("CMAKE_BUILD_TYPE");
       (*it)->GetIncludeDirectories(includeDirs, l->second, "C", config);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 23ec08a..b9de4d8 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1108,6 +1108,16 @@ void cmGlobalGenerator::CreateGeneratorTargets()
       this->ComputeTargetObjects(gt);
       generatorTargets[t] = gt;
       }
+
+    for(std::vector<cmTarget*>::const_iterator
+          j = mf->GetOwnedImportedTargets().begin();
+        j != mf->GetOwnedImportedTargets().end(); ++j)
+      {
+      cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
+      this->GeneratorTargets[*j] = gt;
+      generatorTargets[*j] = gt;
+      }
+
     mf->SetGeneratorTargets(generatorTargets);
     }
 }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4f4f725..4952a8c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -745,6 +745,10 @@ void cmLocalGenerator
   for(cmGeneratorTargetsType::iterator l = tgts.begin();
       l != tgts.end(); l++)
     {
+    if (l->first->IsImported())
+      {
+      continue;
+      }
     cmGeneratorTarget& target = *l->second;
     switch(target.GetType())
       {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04421042b3eb5977208929ba01faf7816c2f8f69
commit 04421042b3eb5977208929ba01faf7816c2f8f69
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 10 00:06:40 2012 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 22 14:01:35 2012 -0400

    GenEx: Add an accessor for imported targets in a makefile.

diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 80a50d6..70cfe54 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -519,6 +519,10 @@ public:
    * Get the list of targets, const version
    */
   const cmTargets &GetTargets() const { return this->Targets; }
+  const std::vector<cmTarget*> &GetOwnedImportedTargets() const
+    {
+      return this->ImportedTargetsOwned;
+    }
 
   const cmGeneratorTargetsType &GetGeneratorTargets() const
     {

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list