[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1999-gc53d0f1

Stephen Kelly steveire at gmail.com
Thu Feb 7 10:21: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  c53d0f18a8fb38c2d38c113c7341b2e95691eba6 (commit)
       via  d4e5c6787c40e27394c336730f59d878a81d1991 (commit)
       via  1fb545ad3a8f6d263c9f01300bce978e81b6fe8c (commit)
       via  57175d559ee2bdd56c360a3b45aacf13b15b9270 (commit)
       via  4cf161a5e7af6f32d76263ac751600577e4d7bd3 (commit)
       via  3a298c0bf4e3e86f4705b9255bf032cf70d5cadb (commit)
       via  655e98bf7149eb3757a0587409076326edeb9c04 (commit)
       via  46e28960a58a25bbf0124b6ab95eda24cc4fe1a4 (commit)
       via  5f926a58026c3c750738e26975834b662fc85727 (commit)
       via  7c0ec75cfa6860b53036fe46c005b84277cdbc24 (commit)
       via  92e98dd909bd399f508ff7c2f9657095ddc766cc (commit)
      from  911b65c2fbab85bff5f3425bbeb70a1d74c63981 (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=c53d0f18a8fb38c2d38c113c7341b2e95691eba6
commit c53d0f18a8fb38c2d38c113c7341b2e95691eba6
Merge: 911b65c d4e5c67
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 10:21:37 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 7 10:21:37 2013 -0500

    Merge topic 'minor-fixes' into next
    
    d4e5c67 Don't keep track of content determined by target property values.
    1fb545a Move a special case for PIC from the genex to the cmTarget code.
    57175d5 Only use early evaluation termination for transitive properties.
    4cf161a Fix determination of evaluating link libraries.
    3a298c0 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
    655e98b Ensure type specific compatible interface properties do not intersect.
    46e2896 The COMPATIBLE_INTERFACE does not affect the target it is set on.
    5f926a5 Test printing origin of include dirs from tll().
    7c0ec75 De-duplicate validation of genex target names.
    92e98dd Deduplicate the isGeneratorExpression method.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4e5c6787c40e27394c336730f59d878a81d1991
commit d4e5c6787c40e27394c336730f59d878a81d1991
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 13:04:46 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Don't keep track of content determined by target property values.
    
    This tracking was added during the development of commit 042ecf04
    (Add API to calculate link-interface-dependent bool properties
    or error., 2013-01-06), but was never used.
    
    It was not necessary to use the content because what is really
    useful in that logic is to determine if a property has been implied
    to be null by appearing in a LINK_LIBRARIES genex.
    
    I think the motivating usecase for developing the feature of
    keeping track of the targets relevant to a property was that I
    thought it would  make it possible to allow requiring granular
    compatibility of interface properties only for targets which
    depended on the interface property. Eg:
    
     add_library(foo ...)
     add_library(bar ...)
    
     add_executable(user ...)
     # Read the INTERFACE_POSITION_INDEPENDENT_CODE from bar, but not
     # from foo:
     target_link_libraries(user foo $<$<TARGET_PROPERTY:POSTITION_INDEPENDENT_CODE>:bar>)
    
    This obviously doesn't make sense. We require that INTERFACE
    properties are consistent across all linked targets instead.

diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 60bf179..5d162fe 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -95,14 +95,13 @@ const char *cmCompiledGeneratorExpression::Evaluate(
 
   for ( ; it != end; ++it)
     {
-    const std::string result = (*it)->Evaluate(&context, dagChecker);
-    this->Output += result;
+    this->Output += (*it)->Evaluate(&context, dagChecker);
 
     for(std::set<cmStdString>::const_iterator
           p = context.SeenTargetProperties.begin();
           p != context.SeenTargetProperties.end(); ++p)
       {
-      this->SeenTargetProperties[*p] += result + ";";
+      this->SeenTargetProperties.insert(*p);
       }
     if (context.HadError)
       {
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 4eab2dd..489b052 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -90,7 +90,7 @@ public:
   std::set<cmTarget*> const& GetTargets() const
     { return this->Targets; }
 
-  std::map<cmStdString, cmStdString> const& GetSeenTargetProperties() const
+  std::set<cmStdString> const& GetSeenTargetProperties() const
     { return this->SeenTargetProperties; }
 
   ~cmCompiledGeneratorExpression();
@@ -124,7 +124,7 @@ private:
   bool NeedsParsing;
 
   mutable std::set<cmTarget*> Targets;
-  mutable std::map<cmStdString, cmStdString> SeenTargetProperties;
+  mutable std::set<cmStdString> SeenTargetProperties;
   mutable std::string Output;
   mutable bool HadContextSensitiveCondition;
 };
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index f601ea3..d2dbf11 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -398,7 +398,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
       {
       // Keep track of the properties seen while processing.
       // The evaluation of the LINK_LIBRARIES generator expressions
-      // will check this to ensure that properties form a DAG.
+      // will check this to ensure that properties have one consistent
+      // value for all evaluations.
       context->SeenTargetProperties.insert(propertyName);
       }
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6f197b8..f55999f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2233,7 +2233,15 @@ void cmTarget::GetDirectLinkLibraries(const char *config,
                                         &dagChecker),
                                       libs);
 
-    this->AddLinkDependentTargetsForProperties(cge->GetSeenTargetProperties());
+    std::set<cmStdString> seenProps = cge->GetSeenTargetProperties();
+    for (std::set<cmStdString>::const_iterator it = seenProps.begin();
+        it != seenProps.end(); ++it)
+      {
+      if (!this->GetProperty(it->c_str()))
+        {
+        this->LinkImplicitNullProperties.insert(*it);
+        }
+      }
     }
 }
 
@@ -4520,18 +4528,6 @@ const char* cmTarget::GetExportMacro()
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::GetLinkDependentTargetsForProperty(const std::string &p,
-                                          std::set<std::string> &targets)
-{
-  const std::map<cmStdString, std::set<std::string> >::const_iterator findIt
-                                  = this->LinkDependentProperties.find(p);
-  if (findIt != this->LinkDependentProperties.end())
-    {
-    targets = findIt->second;
-    }
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p)
 {
   return this->LinkImplicitNullProperties.find(p)
@@ -4539,24 +4535,6 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p)
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::AddLinkDependentTargetsForProperties(
-                              const std::map<cmStdString, cmStdString> &map)
-{
-  for (std::map<cmStdString, cmStdString>::const_iterator it = map.begin();
-       it != map.end(); ++it)
-    {
-    std::vector<std::string> targets;
-    cmSystemTools::ExpandListArgument(it->second.c_str(), targets);
-    this->LinkDependentProperties[it->first].insert(targets.begin(),
-                                                    targets.end());
-    if (!this->GetProperty(it->first.c_str()))
-      {
-      this->LinkImplicitNullProperties.insert(it->first);
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
 template<typename PropertyType>
 PropertyType getTypedProperty(cmTarget *tgt, const char *prop,
                               PropertyType *);
@@ -4611,9 +4589,6 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt,
   const bool explicitlySet = tgt->GetProperties()
                                   .find(p.c_str())
                                   != tgt->GetProperties().end();
-  std::set<std::string> dependentTargets;
-  tgt->GetLinkDependentTargetsForProperty(p,
-                                          dependentTargets);
   const bool impliedByUse =
           tgt->IsNullImpliedByLinkLibraries(p);
   assert((impliedByUse ^ explicitlySet)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 7577a59..fb1496f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -498,17 +498,12 @@ public:
 
   void AppendBuildInterfaceIncludes();
 
-  void GetLinkDependentTargetsForProperty(const std::string &p,
-                                       std::set<std::string> &targets);
   bool IsNullImpliedByLinkLibraries(const std::string &p);
   bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
                                             const char *config);
   bool IsLinkInterfaceDependentStringProperty(const std::string &p,
                                               const char *config);
 
-  void AddLinkDependentTargetsForProperties(
-          const std::map<cmStdString, cmStdString> &map);
-
   bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
                                              const char *config);
 
@@ -627,8 +622,6 @@ private:
   bool IsApple;
   bool IsImportedTarget;
   bool DebugIncludesDone;
-  mutable std::map<cmStdString, std::set<std::string> >
-                                                      LinkDependentProperties;
   mutable std::set<std::string> LinkImplicitNullProperties;
   bool BuildInterfaceIncludesAppended;
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fb545ad3a8f6d263c9f01300bce978e81b6fe8c
commit 1fb545ad3a8f6d263c9f01300bce978e81b6fe8c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 13:13:44 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Move a special case for PIC from the genex to the cmTarget code.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 0ac1e76..f601ea3 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -460,12 +460,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
         {
         return std::string();
         }
-      if (propertyName == "POSITION_INDEPENDENT_CODE")
-        {
-        context->HadContextSensitiveCondition = true;
-        return target->GetLinkInterfaceDependentBoolProperty(
-                    "POSITION_INDEPENDENT_CODE", context->Config) ? "1" : "0";
-        }
       if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
                                                        context->Config))
         {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b92bf77..6f197b8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4797,7 +4797,8 @@ bool isLinkDependentProperty(cmTarget *tgt, const std::string &p,
 bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
                                            const char *config)
 {
-  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_BOOL",
+  return (p == "POSITION_INDEPENDENT_CODE") ||
+    isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_BOOL",
                                  config);
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57175d559ee2bdd56c360a3b45aacf13b15b9270
commit 57175d559ee2bdd56c360a3b45aacf13b15b9270
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 12:33:20 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Only use early evaluation termination for transitive properties.
    
    We need to make sure expressions which evaluate TARGET_PROPERTY:TYPE
    multiple times for example get the correct result each time, and
    not an empty string instead.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 4779b11..0ac1e76 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -434,8 +434,17 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
       // No error. We just skip cyclic references.
       return std::string();
     case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
-      // No error. We're not going to find anything new here.
-      return std::string();
+      for (size_t i = 0;
+          i < (sizeof(targetPropertyTransitiveWhitelist) /
+                sizeof(*targetPropertyTransitiveWhitelist));
+          ++i)
+        {
+        if (targetPropertyTransitiveWhitelist[i] == propertyName)
+          {
+          // No error. We're not going to find anything new here.
+          return std::string();
+          }
+        }
     case cmGeneratorExpressionDAGChecker::DAG:
       break;
       }
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index cd0fe11..19ee59f 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -103,4 +103,7 @@ target_compile_definitions(depG INTERFACE
 )
 
 add_executable(targetC targetC.cpp)
-target_link_libraries(targetC depG)
+# Creates a generator expression for include directories like
+#  $<$<TARGET_DEFINED:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>>:\
+#    $<TARGET_PROPERTY:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>,INTERFACE_INCLUDE_DIRECTORIES>>
+target_link_libraries(targetC $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cf161a5e7af6f32d76263ac751600577e4d7bd3
commit 4cf161a5e7af6f32d76263ac751600577e4d7bd3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 12:31:18 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Fix determination of evaluating link libraries.
    
    Added in commit 6fbe3ce4 (Exclude the LINK_LIBRARIES related properties
    from INTERFACE evaluation., 2013-01-23)

diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index b9069ef..0ac1a48 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -148,8 +148,8 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries()
   return (strcmp(prop, "LINK_LIBRARIES") == 0
        || strcmp(prop, "LINK_INTERFACE_LIBRARIES") == 0
        || strcmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
-       || strncmp(prop, "LINK_INTERFACE_LIBRARIES_", 26) == 0
-       || strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_", 35) == 0);
+       || strncmp(prop, "LINK_INTERFACE_LIBRARIES_", 25) == 0
+       || strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_", 34) == 0);
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a298c0bf4e3e86f4705b9255bf032cf70d5cadb
commit 3a298c0bf4e3e86f4705b9255bf032cf70d5cadb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 01:49:17 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
    
    As INTERFACE_COMPILE_DEFINITIONS are now possible, we can have
    situations like this:
    
     add_library(foo ...)
     add_library(bar ...)
     target_link_libraries(foo bar)
    
     target_compile_definitions(bar INTERFACE SOME_DEF)
    
    The INTERFACE_COMPILE_DEFINITIONS of bar determine how foo should be
    compiled, and if they change, foo should be rebuilt.
    
    Additionally, as of commit d1446ca7 (Append the COMPILE_DEFINITIONS
    from the Makefile to all targets., 2012-09-17), we don't need to
    read definitions from the makefile if we read them from the target,
    so also de-duplicate the cached info.
    
    The DependInfo for INTERFACE_INCLUDE_DIRECTORIES is already handled
    correctly.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index d629e71..f6ab0d0 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1961,34 +1961,17 @@ void cmLocalUnixMakefileGenerator3
     }
 
   // Build a list of preprocessor definitions for the target.
-  std::vector<std::string> defines;
-  {
-  std::string defPropName = "COMPILE_DEFINITIONS_";
-  defPropName += cmSystemTools::UpperCase(this->ConfigurationName);
-  if(const char* ddefs = this->Makefile->GetProperty("COMPILE_DEFINITIONS"))
-    {
-    cmSystemTools::ExpandListArgument(ddefs, defines);
-    }
-  if(const char* cdefs = target.GetProperty("COMPILE_DEFINITIONS"))
-    {
-    cmSystemTools::ExpandListArgument(cdefs, defines);
-    }
-  if(const char* dcdefs = this->Makefile->GetProperty(defPropName.c_str()))
-    {
-    cmSystemTools::ExpandListArgument(dcdefs, defines);
-    }
-  if(const char* ccdefs = target.GetProperty(defPropName.c_str()))
-    {
-    cmSystemTools::ExpandListArgument(ccdefs, defines);
-    }
-  }
+  std::set<std::string> defines;
+  this->AppendDefines(defines, target.GetCompileDefinitions());
+  this->AppendDefines(defines, target.GetCompileDefinitions(
+                                            this->ConfigurationName.c_str()));
   if(!defines.empty())
     {
     cmakefileStream
       << "\n"
       << "# Preprocessor definitions for this target.\n"
       << "SET(CMAKE_TARGET_DEFINITIONS\n";
-    for(std::vector<std::string>::const_iterator di = defines.begin();
+    for(std::set<std::string>::const_iterator di = defines.begin();
         di != defines.end(); ++di)
       {
       cmakefileStream

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=655e98bf7149eb3757a0587409076326edeb9c04
commit 655e98bf7149eb3757a0587409076326edeb9c04
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 00:47:31 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Ensure type specific compatible interface properties do not intersect.
    
    Before, the boolean version would always win, and the string one would
    be ignored.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4109929..b92bf77 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -906,7 +906,10 @@ void cmTarget::DefineProperties(cmake *cm)
      "consistent with each other, and with the \"FOO\" property in the "
      "dependee.  Consistency in this sense has the meaning that if the "
      "property is set, then it must have the same boolean value as all "
-     "others, and if the property is not set, then it is ignored.");
+     "others, and if the property is not set, then it is ignored.  Note that "
+     "for each dependee, the set of properties from this property must not "
+     "intersect with the set of properties from the "
+     "COMPATIBLE_INTERFACE_STRING property.");
 
   cm->DefineProperty
     ("COMPATIBLE_INTERFACE_STRING", cmProperty::TARGET,
@@ -917,7 +920,10 @@ void cmTarget::DefineProperties(cmake *cm)
      "if a property \"FOO\" appears in the list, then for each dependee, the "
      "\"INTERFACE_FOO\" property content in all of its dependencies must be "
      "equal with each other, and with the \"FOO\" property in the dependee.  "
-     "If the property is not set, then it is ignored.");
+     "If the property is not set, then it is ignored.  Note that for each "
+     "dependee, the set of properties from this property must not intersect "
+     "with the set of properties from the COMPATIBLE_INTERFACE_BOOL "
+     "property.");
 
   cm->DefineProperty
     ("POST_INSTALL_SCRIPT", cmProperty::TARGET,
@@ -5616,7 +5622,8 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
 {
   const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
 
-  std::set<cmStdString> emitted;
+  std::set<cmStdString> emittedBools;
+  std::set<cmStdString> emittedStrings;
 
   for(cmComputeLinkInformation::ItemVector::const_iterator li =
       deps.begin();
@@ -5629,19 +5636,36 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
 
     checkPropertyConsistency<bool>(this, li->Target,
                                    "COMPATIBLE_INTERFACE_BOOL",
-                                   emitted, config, 0);
+                                   emittedBools, config, 0);
     if (cmSystemTools::GetErrorOccuredFlag())
       {
       return;
       }
     checkPropertyConsistency<const char *>(this, li->Target,
                                            "COMPATIBLE_INTERFACE_STRING",
-                                           emitted, config, 0);
+                                           emittedStrings, config, 0);
     if (cmSystemTools::GetErrorOccuredFlag())
       {
       return;
       }
     }
+
+  for(std::set<cmStdString>::const_iterator li = emittedBools.begin();
+      li != emittedBools.end(); ++li)
+    {
+    const std::set<cmStdString>::const_iterator si = emittedStrings.find(*li);
+    if (si != emittedStrings.end())
+      {
+      cmOStringStream e;
+      e << "Property \"" << *li << "\" appears in both the "
+      "COMPATIBLE_INTERFACE_BOOL and the COMPATIBLE_INTERFACE_STRING "
+      "property in the dependencies of target \"" << this->GetName() <<
+      "\".  This is not allowed. A property may only require compatibility "
+      "in a boolean interpretation or a string interpretation, but not both.";
+      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+      break;
+      }
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
new file mode 100644
index 0000000..5a8f99d
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error in CMakeLists.txt:
+  Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the
+  COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user".
+  This is not allowed.  A property may only require compatibility in a
+  boolean interpretation or a string interpretation, but not both.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
new file mode 100644
index 0000000..711368a
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
@@ -0,0 +1,9 @@
+
+add_library(foo UNKNOWN IMPORTED)
+add_library(bar UNKNOWN IMPORTED)
+
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING)
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING)
+
+add_executable(user main.cpp)
+target_link_libraries(user foo bar)
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index 922ad7f..9768151 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -8,3 +8,4 @@ run_cmake(InterfaceString-mismatch-depends)
 run_cmake(InterfaceString-mismatch-depend-self)
 run_cmake(InterfaceString-mismatched-use)
 run_cmake(InterfaceString-builtin-prop)
+run_cmake(InterfaceString-Bool-Conflict)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=46e28960a58a25bbf0124b6ab95eda24cc4fe1a4
commit 46e28960a58a25bbf0124b6ab95eda24cc4fe1a4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 00:43:54 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    The COMPATIBLE_INTERFACE does not affect the target it is set on.
    
    Test and document this.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2eaf1c1..4109929 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -900,24 +900,24 @@ void cmTarget::DefineProperties(cmake *cm)
      "Properties which must be compatible with their link interface",
      "The COMPATIBLE_INTERFACE_BOOL property may contain a list of properties"
      "for this target which must be consistent when evaluated as a boolean "
-     "in the INTERFACE of all linked dependencies.  For example, if a "
-     "property \"FOO\" appears in the list, then the \"INTERFACE_FOO\" "
-     "property content in all dependencies must be consistent with each "
-     "other, and with the \"FOO\" property in this target.  "
-     "Consistency in this sense has the meaning that if the property is set,"
-     "then it must have the same boolean value as all others, and if the "
-     "property is not set, then it is ignored.");
+     "in the INTERFACE of all linked dependees.  For example, if a "
+     "property \"FOO\" appears in the list, then for each dependee, the "
+     "\"INTERFACE_FOO\" property content in all of its dependencies must be "
+     "consistent with each other, and with the \"FOO\" property in the "
+     "dependee.  Consistency in this sense has the meaning that if the "
+     "property is set, then it must have the same boolean value as all "
+     "others, and if the property is not set, then it is ignored.");
 
   cm->DefineProperty
     ("COMPATIBLE_INTERFACE_STRING", cmProperty::TARGET,
      "Properties which must be string-compatible with their link interface",
      "The COMPATIBLE_INTERFACE_STRING property may contain a list of "
      "properties for this target which must be the same when evaluated as "
-     "a string in the INTERFACE of all linked dependencies.  For example, "
-     "if a property \"FOO\" appears in the list, then the \"INTERFACE_FOO\" "
-     "property content in all dependencies must be equal with each "
-     "other, and with the \"FOO\" property in this target.  If the "
-     "property is not set, then it is ignored.");
+     "a string in the INTERFACE of all linked dependees.  For example, "
+     "if a property \"FOO\" appears in the list, then for each dependee, the "
+     "\"INTERFACE_FOO\" property content in all of its dependencies must be "
+     "equal with each other, and with the \"FOO\" property in the dependee.  "
+     "If the property is not set, then it is ignored.");
 
   cm->DefineProperty
     ("POST_INSTALL_SCRIPT", cmProperty::TARGET,
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index 329510b..cd0a37d 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -67,3 +67,18 @@ target_compile_definitions(CompatibleInterface
   PRIVATE
     $<$<BOOL:$<TARGET_PROPERTY:Iface2_PROP>>:SOME_DEFINE>
 )
+
+# The COMPATIBLE_INTERFACE_* properties are only read from dependencies
+# in the interface. Populating it on the CompatibleInterface target does
+# not have any affect on the interpretation of the INTERFACE variants
+# in dependencies.
+set_property(TARGET iface1 PROPERTY
+  INTERFACE_NON_RELEVANT_PROP ON
+)
+set_property(TARGET iface2 PROPERTY
+  INTERFACE_NON_RELEVANT_PROP ON
+)
+set_property(TARGET CompatibleInterface APPEND PROPERTY
+  COMPATIBLE_INTERFACE_BOOL
+    NON_RELEVANT_PROP
+)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f926a58026c3c750738e26975834b662fc85727
commit 5f926a58026c3c750738e26975834b662fc85727
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Feb 5 10:24:39 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:09 2013 +0100

    Test printing origin of include dirs from tll().

diff --git a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt
index 736fe69..c17e0ae 100644
--- a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt
+++ b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt
@@ -23,13 +23,21 @@ CMake Debug Log at DebugIncludes.cmake:18 \(include_directories\):
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 +
-CMake Debug Log at DebugIncludes.cmake:25 \(set_property\):
+CMake Debug Log at DebugIncludes.cmake:26 \(target_link_libraries\):
   Used includes for target lll:
 
    \* .*/Tests/RunCMake/include_directories/five
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
++
+CMake Debug Log at DebugIncludes.cmake:29 \(set_property\):
+  Used includes for target lll:
+
    \* .*/Tests/RunCMake/include_directories/six
+   \* .*/Tests/RunCMake/include_directories/seven
 
 Call Stack \(most recent call first\):
-  DebugIncludes.cmake:35 \(some_macro\)
-  DebugIncludes.cmake:38 \(some_function\)
+  DebugIncludes.cmake:40 \(some_macro\)
+  DebugIncludes.cmake:43 \(some_function\)
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/include_directories/DebugIncludes.cmake b/Tests/RunCMake/include_directories/DebugIncludes.cmake
index 51daf74..794a852 100644
--- a/Tests/RunCMake/include_directories/DebugIncludes.cmake
+++ b/Tests/RunCMake/include_directories/DebugIncludes.cmake
@@ -21,6 +21,10 @@ include_directories(
   "${CMAKE_CURRENT_SOURCE_DIR}/four"
 )
 
+add_library(foo "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp")
+target_include_directories(foo INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/five")
+target_link_libraries(lll foo)
+
 macro(some_macro)
   set_property(TARGET lll APPEND PROPERTY
       INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/one"
@@ -28,6 +32,7 @@ macro(some_macro)
                           "${CMAKE_CURRENT_SOURCE_DIR}/four"
                           "${CMAKE_CURRENT_SOURCE_DIR}/five"
                           "${CMAKE_CURRENT_SOURCE_DIR}/six"
+                          "${CMAKE_CURRENT_SOURCE_DIR}/seven"
   )
 endmacro()
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c0ec75cfa6860b53036fe46c005b84277cdbc24
commit 7c0ec75cfa6860b53036fe46c005b84277cdbc24
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 6 13:32:15 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:08 2013 +0100

    De-duplicate validation of genex target names.

diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index c9f784b..60bf179 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -371,10 +371,20 @@ std::string::size_type cmGeneratorExpression::Find(const std::string &input)
 {
   const std::string::size_type openpos = input.find("$<");
   if (openpos != std::string::npos
-        && input.find(">", openpos) != std::string::npos)
-      {
-      return openpos;
-      }
+      && input.find(">", openpos) != std::string::npos)
+    {
+    return openpos;
     }
   return std::string::npos;
 }
+
+//----------------------------------------------------------------------------
+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_.:-]+$");
+
+  return targetNameValidator.find(input.c_str());
+}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index d487919..4eab2dd 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -64,6 +64,8 @@ public:
 
   static std::string::size_type Find(const std::string &input);
 
+  static bool IsValidTargetName(const std::string &input);
+
 private:
   cmGeneratorExpression(const cmGeneratorExpression &);
   void operator=(const cmGeneratorExpression &);
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 5d94718..4779b11 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -333,10 +333,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
           "$<TARGET_PROPERTY:...> expression requires one or two parameters");
       return std::string();
       }
-    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_]+$");
 
@@ -372,7 +368,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 
       std::string targetName = parameters.front();
       propertyName = parameters[1];
-      if (!targetNameValidator.find(targetName.c_str()))
+      if (!cmGeneratorExpression::IsValidTargetName(targetName))
         {
         if (!propertyNameValidator.find(propertyName.c_str()))
           {
@@ -867,10 +863,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
     // Lookup the referenced target.
     std::string name = *parameters.begin();
 
-    cmsys::RegularExpression targetValidator;
-    // The ':' is supported to allow use with IMPORTED targets.
-    targetValidator.compile("^[A-Za-z0-9_.:-]+$");
-    if (!targetValidator.find(name.c_str()))
+    if (!cmGeneratorExpression::IsValidTargetName(name))
       {
       ::reportError(context, content->GetOriginalExpression(),
                     "Expression syntax not recognized.");
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index fab3306..9dd0e5b 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -11,6 +11,8 @@
 ============================================================================*/
 #include "cmTargetLinkLibrariesCommand.h"
 
+#include "cmGeneratorExpression.h"
+
 const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] =
 {
   "general",
@@ -271,9 +273,8 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
 {
   const bool isGenex = cmGeneratorExpression::Find(lib) != std::string::npos;
 
-  cmsys::RegularExpression targetNameValidator;
-  targetNameValidator.compile("^[A-Za-z0-9_.:-]+$");
-  const bool potentialTargetName = targetNameValidator.find(lib);
+  const bool potentialTargetName
+                              = cmGeneratorExpression::IsValidTargetName(lib);
 
   if (potentialTargetName || isGenex)
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92e98dd909bd399f508ff7c2f9657095ddc766cc
commit 92e98dd909bd399f508ff7c2f9657095ddc766cc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 6 13:18:10 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 16:21:08 2013 +0100

    Deduplicate the isGeneratorExpression method.
    
    This API seems like the most appropriate.

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 7e4c3df..fbed95a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -315,14 +315,6 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
 }
 
 //----------------------------------------------------------------------------
-static bool isGeneratorExpression(const std::string &lib)
-{
-  const std::string::size_type openpos = lib.find("$<");
-  return (openpos != std::string::npos)
-      && (lib.find(">", openpos) != std::string::npos);
-}
-
-//----------------------------------------------------------------------------
 void
 cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
                                     std::string &input,
@@ -344,7 +336,7 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpressions(
   for(std::vector<std::string>::iterator li = parts.begin();
       li != parts.end(); ++li)
     {
-    if (!isGeneratorExpression(*li))
+    if (cmGeneratorExpression::Find(*li) == std::string::npos)
       {
       this->AddTargetNamespace(*li, target, missingTargets);
       }
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 7add1bf..c9f784b 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -365,3 +365,16 @@ std::string cmGeneratorExpression::Preprocess(const std::string &input,
   assert(!"cmGeneratorExpression::Preprocess called with invalid args");
   return std::string();
 }
+
+//----------------------------------------------------------------------------
+std::string::size_type cmGeneratorExpression::Find(const std::string &input)
+{
+  const std::string::size_type openpos = input.find("$<");
+  if (openpos != std::string::npos
+        && input.find(">", openpos) != std::string::npos)
+      {
+      return openpos;
+      }
+    }
+  return std::string::npos;
+}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 700fe03..d487919 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -62,6 +62,8 @@ public:
   static void Split(const std::string &input,
                     std::vector<std::string> &output);
 
+  static std::string::size_type Find(const std::string &input);
+
 private:
   cmGeneratorExpression(const cmGeneratorExpression &);
   void operator=(const cmGeneratorExpression &);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ca0e24b..2eaf1c1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2270,14 +2270,6 @@ static std::string targetNameGenex(const char *lib)
 }
 
 //----------------------------------------------------------------------------
-static bool isGeneratorExpression(const std::string &lib)
-{
-  const std::string::size_type openpos = lib.find("$<");
-  return (openpos != std::string::npos)
-      && (lib.find(">", openpos) != std::string::npos);
-}
-
-//----------------------------------------------------------------------------
 void cmTarget::AddLinkLibrary(cmMakefile& mf,
                               const char *target, const char* lib,
                               LinkLibraryType llt)
@@ -2300,7 +2292,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
                                                           llt).c_str());
   }
 
-  if (isGeneratorExpression(lib))
+  if (cmGeneratorExpression::Find(lib) != std::string::npos)
     {
     return;
     }
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index eaacfa9..808806a 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -41,14 +41,6 @@ void cmTargetIncludeDirectoriesCommand
 }
 
 //----------------------------------------------------------------------------
-static bool isGeneratorExpression(const std::string &lib)
-{
-  const std::string::size_type openpos = lib.find("$<");
-  return (openpos != std::string::npos)
-      && (lib.find(">", openpos) != std::string::npos);
-}
-
-//----------------------------------------------------------------------------
 std::string cmTargetIncludeDirectoriesCommand
 ::Join(const std::vector<std::string> &content)
 {
@@ -59,7 +51,7 @@ std::string cmTargetIncludeDirectoriesCommand
     it != content.end(); ++it)
     {
     if (cmSystemTools::FileIsFullPath(it->c_str())
-        || isGeneratorExpression(*it))
+        || cmGeneratorExpression::Find(*it) != std::string::npos)
       {
       dirs += sep + *it;
       }
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index cb913f5..fab3306 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -265,19 +265,11 @@ static std::string compileProperty(cmTarget *tgt, const std::string &lib,
 }
 
 //----------------------------------------------------------------------------
-static bool isGeneratorExpression(const std::string &lib)
-{
-  const std::string::size_type openpos = lib.find("$<");
-  return (openpos != std::string::npos)
-      && (lib.find(">", openpos) != std::string::npos);
-}
-
-//----------------------------------------------------------------------------
 void
 cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
                                             cmTarget::LinkLibraryType llt)
 {
-  const bool isGenex = isGeneratorExpression(lib);
+  const bool isGenex = cmGeneratorExpression::Find(lib) != std::string::npos;
 
   cmsys::RegularExpression targetNameValidator;
   targetNameValidator.compile("^[A-Za-z0-9_.:-]+$");

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list