Browse Source

Add API to check if we're reading a includes or defines property.

This will allow the implementation of the LINKED generator expression.
Stephen Kelly 13 years ago
parent
commit
0fa7f69c0e

+ 16 - 0
Source/cmGeneratorExpressionDAGChecker.cxx

@@ -125,3 +125,19 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries()
        || strncmp(prop, "LINK_INTERFACE_LIBRARIES_", 26) == 0
        || strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_", 35) == 0);
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::EvaluatingIncludeDirectories()
+{
+  const char *prop = this->Property.c_str();
+  return (strcmp(prop, "INCLUDE_DIRECTORIES") == 0
+       || strcmp(prop, "INTERFACE_INCLUDE_DIRECTORIES") == 0 );
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions()
+{
+  const char *prop = this->Property.c_str();
+  return (strcmp(prop, "COMPILE_DEFINITIONS") == 0
+       || strcmp(prop, "INTERFACE_COMPILE_DEFINITIONS") == 0 );
+}

+ 2 - 0
Source/cmGeneratorExpressionDAGChecker.h

@@ -37,6 +37,8 @@ struct cmGeneratorExpressionDAGChecker
                    const std::string &expr);
 
   bool EvaluatingLinkLibraries();
+  bool EvaluatingIncludeDirectories();
+  bool EvaluatingCompileDefinitions();
 
 private:
   Result checkGraph() const;