[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1958-g4057eff

Stephen Kelly steveire at gmail.com
Wed Feb 6 20:26:57 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  4057effc4de213e948a5e8be78ce4a01d13140e5 (commit)
       via  d5d964604b7d837c1ef6d5b77e2637733caa7503 (commit)
       via  c88ec906f3a62be61e49f7d042e0297ed4629c1a (commit)
       via  2c7f15749d59dc7575afa6cf96c642f2b7ebb4d6 (commit)
       via  6788da75b51c677b580ff9db8a84841949ba2758 (commit)
       via  c191002a1db73d3b0c009a121eb2f382874ca120 (commit)
       via  118f563c96c9703e86361acbbeeb64185af1064b (commit)
       via  60a2e34c12ec161678fb384f15287a81ecfcf24b (commit)
       via  2ce7231f56807b62917e6da1336f033d5386694a (commit)
       via  47eacab06da33230fb06c9075a287d465aa237c4 (commit)
      from  0c299664eb183f02272d0ecb86bd54e3794369ea (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=4057effc4de213e948a5e8be78ce4a01d13140e5
commit 4057effc4de213e948a5e8be78ce4a01d13140e5
Merge: 0c29966 d5d9646
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 6 20:26:53 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 6 20:26:53 2013 -0500

    Merge topic 'minor-fixes' into next
    
    d5d9646 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
    c88ec90 Ensure type specific compatible interface properties do not intersect.
    2c7f157 The COMPATIBLE_INTERFACE does not affect the target it is set on.
    6788da7 Test printing origin of include dirs from tll().
    c191002 De-duplicate validation of genex target names.
    118f563 Deduplicate the isGeneratorExpression method.
    60a2e34 Process generator expressions for 'system' include directories.
    2ce7231 Style: Use this-> when invoking member functions.
    47eacab CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5d964604b7d837c1ef6d5b77e2637733caa7503
commit d5d964604b7d837c1ef6d5b77e2637733caa7503
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 01:49:17 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=c88ec906f3a62be61e49f7d042e0297ed4629c1a
commit c88ec906f3a62be61e49f7d042e0297ed4629c1a
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 00:57:54 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=2c7f15749d59dc7575afa6cf96c642f2b7ebb4d6
commit 2c7f15749d59dc7575afa6cf96c642f2b7ebb4d6
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 00:43:54 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=6788da75b51c677b580ff9db8a84841949ba2758
commit 6788da75b51c677b580ff9db8a84841949ba2758
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 00:19:32 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=c191002a1db73d3b0c009a121eb2f382874ca120
commit c191002a1db73d3b0c009a121eb2f382874ca120
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 00:19:32 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 2745e80..520c7a8 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -281,9 +281,8 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
 {
   const bool isGenex = isGeneratorExpression(lib);
 
-  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=118f563c96c9703e86361acbbeeb64185af1064b
commit 118f563c96c9703e86361acbbeeb64185af1064b
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 00:17: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..b766113 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) != -1)
       {
       dirs += sep + *it;
       }
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index cb913f5..2745e80 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",

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60a2e34c12ec161678fb384f15287a81ecfcf24b
commit 60a2e34c12ec161678fb384f15287a81ecfcf24b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 25 09:26:35 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 00:10:04 2013 +0100

    Process generator expressions for 'system' include directories.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ecf6b41..dc39fdc 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1212,7 +1212,8 @@ cmLocalGenerator::ConvertToIncludeReference(std::string const& path)
 //----------------------------------------------------------------------------
 std::string cmLocalGenerator::GetIncludeFlags(
                                      const std::vector<std::string> &includes,
-                                     const char* lang, bool forResponseFile)
+                                     const char* lang, bool forResponseFile,
+                                     const char *config)
 {
   if(!lang)
     {
@@ -1285,7 +1286,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
     if(!flagUsed || repeatFlag)
       {
       if(sysIncludeFlag &&
-         this->Makefile->IsSystemIncludeDirectory(i->c_str()))
+         this->Makefile->IsSystemIncludeDirectory(i->c_str(), config))
         {
         includeFlags << sysIncludeFlag;
         }
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index b2ff0c4..84cf6ca 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -149,7 +149,8 @@ public:
   virtual void AppendFlags(std::string& flags, const char* newFlags);
   ///! Get the include flags for the current makefile and language
   std::string GetIncludeFlags(const std::vector<std::string> &includes,
-                              const char* lang, bool forResponseFile = false);
+                              const char* lang, bool forResponseFile = false,
+                              const char *config = 0);
 
   /**
    * Encode a list of preprocessor definitions for the compiler
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e7a1500..58e3f8e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -23,6 +23,7 @@
 #include "cmListFileCache.h"
 #include "cmCommandArgumentParserHelper.h"
 #include "cmDocumentCompileDefinitions.h"
+#include "cmGeneratorExpression.h"
 #include "cmTest.h"
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #  include "cmVariableWatch.h"
@@ -1665,10 +1666,24 @@ cmMakefile::AddSystemIncludeDirectories(const std::set<cmStdString> &incs)
 }
 
 //----------------------------------------------------------------------------
-bool cmMakefile::IsSystemIncludeDirectory(const char* dir)
+bool cmMakefile::IsSystemIncludeDirectory(const char* dir, const char *config)
 {
-  return (this->SystemIncludeDirectories.find(dir) !=
-          this->SystemIncludeDirectories.end());
+  for (std::set<cmStdString>::const_iterator
+      it = this->SystemIncludeDirectories.begin();
+      it != this->SystemIncludeDirectories.end(); ++it)
+    {
+    cmListFileBacktrace lfbt;
+    cmGeneratorExpression ge(lfbt);
+
+    std::vector<std::string> incs;
+    cmSystemTools::ExpandListArgument(ge.Parse(*it)
+                                       ->Evaluate(this, config, false), incs);
+    if (std::find(incs.begin(), incs.end(), dir) != incs.end())
+      {
+      return true;
+      }
+    }
+  return false;
 }
 
 void cmMakefile::AddDefinition(const char* name, const char* value)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index a2783f2..c0020bf 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -547,7 +547,7 @@ public:
    * Mark include directories as system directories.
    */
   void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
-  bool IsSystemIncludeDirectory(const char* dir);
+  bool IsSystemIncludeDirectory(const char* dir, const char *config);
 
   /** Expand out any arguements in the vector that have ; separated
    *  strings into multiple arguements.  A new vector is created

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ce7231f56807b62917e6da1336f033d5386694a
commit 2ce7231f56807b62917e6da1336f033d5386694a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 6 11:47:14 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 7 00:10:04 2013 +0100

    Style: Use this-> when invoking member functions.

diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 671e09f..ffb0e80 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -115,13 +115,13 @@ void cmIncludeDirectoryCommand::GetIncludes(const std::string &arg,
     if (pos)
       {
       std::string inc = arg.substr(lastPos,pos);
-      NormalizeInclude(inc);
+      this->NormalizeInclude(inc);
       incs.push_back(inc);
       }
     lastPos = pos + 1;
     }
   std::string inc = arg.substr(lastPos);
-  NormalizeInclude(inc);
+  this->NormalizeInclude(inc);
   incs.push_back(inc);
 }
 

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

Summary of changes:
 Source/CMakeVersion.cmake                          |    2 +-
 Source/cmExportFileGenerator.cxx                   |   10 +---
 Source/cmGeneratorExpression.cxx                   |   23 +++++++
 Source/cmGeneratorExpression.h                     |    4 +
 Source/cmGeneratorExpressionEvaluator.cxx          |   11 +---
 Source/cmIncludeDirectoryCommand.cxx               |    4 +-
 Source/cmLocalGenerator.cxx                        |    5 +-
 Source/cmLocalGenerator.h                          |    3 +-
 Source/cmLocalUnixMakefileGenerator3.cxx           |   27 ++-------
 Source/cmMakefile.cxx                              |   21 ++++++-
 Source/cmMakefile.h                                |    2 +-
 Source/cmTarget.cxx                                |   64 ++++++++++++-------
 Source/cmTargetIncludeDirectoriesCommand.cxx       |   10 +---
 Source/cmTargetLinkLibrariesCommand.cxx            |    7 +-
 Tests/CompatibleInterface/CMakeLists.txt           |   15 +++++
 .../InterfaceString-Bool-Conflict-result.txt}      |    0
 .../InterfaceString-Bool-Conflict-stderr.txt       |    5 ++
 ...s.cmake => InterfaceString-Bool-Conflict.cmake} |    5 +-
 .../CompatibleInterface/RunCMakeTest.cmake         |    1 +
 .../include_directories/DebugIncludes-stderr.txt   |   14 ++++-
 .../include_directories/DebugIncludes.cmake        |    5 ++
 21 files changed, 146 insertions(+), 92 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CompatibleInterface/InterfaceString-Bool-Conflict-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
 copy Tests/RunCMake/CompatibleInterface/{InterfaceBool-mismatch-depends.cmake => InterfaceString-Bool-Conflict.cmake} (61%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list