[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2396-gcab81f2

Stephen Kelly steveire at gmail.com
Wed Mar 6 11:46:42 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  cab81f23cb59bd5cbd50970a91d42f4a465a79e6 (commit)
       via  eed2637e99955c8c762ad1deea65877c43bd1a22 (commit)
       via  254687d31f2f45b0d3ce9085c013ab0e15b360de (commit)
       via  efdf152fe1582be3e39f3a16e0ddaeb386fe1c20 (commit)
      from  d559bec27163c17935eb2cbeab0e41cf0e8fbdc5 (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=cab81f23cb59bd5cbd50970a91d42f4a465a79e6
commit cab81f23cb59bd5cbd50970a91d42f4a465a79e6
Merge: d559bec eed2637
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Mar 6 11:46:39 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Mar 6 11:46:39 2013 -0500

    Merge topic 'fix-transitive-target-names' into next
    
    eed2637 Extend the range of valid target names with the + sign.
    254687d Only process transitive interface properties for valid target names.
    efdf152 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eed2637e99955c8c762ad1deea65877c43bd1a22
commit eed2637e99955c8c762ad1deea65877c43bd1a22
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Mar 6 17:26:40 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Mar 6 17:43:23 2013 +0100

    Extend the range of valid target names with the + sign.
    
    As noted in #13986, this character can commonly be used for target
    names, such as those containing 'c++'.
    
    Suggested-By: Benjamin Kloster

diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 7ea58fa..3f59129 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -393,7 +393,7 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string &input)
   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_.:-]+$");
+  targetNameValidator.compile("^[A-Za-z0-9_.:+-]+$");
 
   return targetNameValidator.find(input.c_str());
 }
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index b13c13d..e4cb217 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -102,7 +102,11 @@ target_compile_definitions(depG INTERFACE
     TEST_DEF
 )
 
+# Linking to a target containing a + should be non-fatal.
+add_library(wrapc++ empty.cpp)
+
 add_executable(targetC targetC.cpp)
+target_link_libraries(targetC wrapc++)
 # The TARGET_PROPERTY expression is duplicated below to test that there is no
 # shortcutting of the evaluation by returning an empty string.
 set(_exe_test $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=254687d31f2f45b0d3ce9085c013ab0e15b360de
commit 254687d31f2f45b0d3ce9085c013ab0e15b360de
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Mar 6 17:15:57 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Mar 6 17:42:08 2013 +0100

    Only process transitive interface properties for valid target names.
    
    Commit a1c4905f (Use the link information as a source of compile
    definitions and includes., 2013-02-12) introduced the use of link
    information as the source of target properties via the TARGET_PROPERTY
    generator expression. This generator expression has a strict
    interpretation of a valid target name and emits a fatal error for
    invalid names.
    
    Ensure that only targets with names valid for use with TARGET_PROPERTY
    or targets which are determined by generator expressions are processed
    by it. This means that at worst, invalid target names do not participate
    in the transitive evaluation of properties, but the validation
    generator expression can be extended where needed to resolve that.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f38b16e..d46325b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2898,7 +2898,8 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
                                                         ge.Parse(it->Value);
       std::string result = cge->Evaluate(this->Makefile, config,
                                         false, this, 0, 0);
-      if (!this->Makefile->FindTargetToUse(result.c_str()))
+      if (!cmGeneratorExpression::IsValidTargetName(result.c_str())
+          || !this->Makefile->FindTargetToUse(result.c_str()))
         {
         continue;
         }
@@ -2975,7 +2976,9 @@ std::string cmTarget::GetCompileDefinitions(const char *config)
   for (std::vector<std::string>::const_iterator it = libs.begin();
       it != libs.end(); ++it)
     {
-    if (this->Makefile->FindTargetToUse(it->c_str()))
+    if ((cmGeneratorExpression::IsValidTargetName(it->c_str())
+          || cmGeneratorExpression::Find(it->c_str()) != std::string::npos)
+        && this->Makefile->FindTargetToUse(it->c_str()))
       {
       depString += sep + "$<TARGET_PROPERTY:"
                 + *it + ",INTERFACE_COMPILE_DEFINITIONS>";

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

Summary of changes:
 Source/CMakeVersion.cmake                          |    2 +-
 Source/cmGeneratorExpression.cxx                   |    2 +-
 Source/cmTarget.cxx                                |    7 +++++--
 .../target_link_libraries/CMakeLists.txt           |    4 ++++
 4 files changed, 11 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list